Public Member Functions | |
| def | __init__ |
| def | get_old_value |
| def | replace |
Public Attributes | |
| arg_pos | |
| name | |
Replaces one value in an ``args, kwargs`` pair. Inspects the function signature to find an argument by name whether it is passed by position or keyword. For use in decorators and similar wrappers.
| def tornado.util.ArgReplacer.__init__ | ( | self, | |
| func, | |||
| name | |||
| ) |
| def tornado.util.ArgReplacer.get_old_value | ( | self, | |
| args, | |||
| kwargs, | |||
default = None |
|||
| ) |
| def tornado.util.ArgReplacer.replace | ( | self, | |
| new_value, | |||
| args, | |||
| kwargs | |||
| ) |
Replace the named argument in ``args, kwargs`` with ``new_value``. Returns ``(old_value, args, kwargs)``. The returned ``args`` and ``kwargs`` objects may not be the same as the input objects, or the input objects may be mutated. If the named argument was not found, ``new_value`` will be added to ``kwargs`` and None will be returned as ``old_value``.