Process named parameter, checking aliases and legacy usage.
Helper function to process function arguments by mapping aliases to either their default keywords or to a named argument. The alias mapping is a dictionary that returns a tuple consisting of valid aliases and legacy aliases:
alias_mapping = { 'argument_name_1': (['alias', ...], ['legacy', ...]), ...}
If param
is a named keyword in the function signature with default value defval
, a typical calling sequence at the start of a function is:
param = _process_param('param', defval, kwargs, function_aliases)
If param
is a variable keyword argument (in kwargs
), defval
can be passed as either None or the default value to use if param
is not present in kwargs
.
Name of the parameter to be checked.
Default value for the parameter.
Dictionary of variable keyword arguments.
Dictionary providing aliases and legacy names.
Default value specified in the function signature (default = None). If specified, an error will be generated if defval
is different than sigval
and an alias or legacy keyword is given.
New value of the named parameter.
If multiple keyword aliases are used for the same parameter.
If legacy name is used to set the value for the variable.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4