Public Member Functions | Public Attributes
tornado.util.ArgReplacer Class Reference

List of all members.

Public Member Functions

def __init__
def get_old_value
def replace

Public Attributes

 arg_pos
 name

Detailed Description

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.

Definition at line 267 of file util.py.


Constructor & Destructor Documentation

def tornado.util.ArgReplacer.__init__ (   self,
  func,
  name 
)

Definition at line 274 of file util.py.


Member Function Documentation

def tornado.util.ArgReplacer.get_old_value (   self,
  args,
  kwargs,
  default = None 
)
Returns the old value of the named argument without replacing it.

Returns ``default`` if the argument is not present.

Definition at line 282 of file util.py.

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``.

Definition at line 292 of file util.py.


Member Data Documentation

Definition at line 274 of file util.py.

Definition at line 274 of file util.py.


The documentation for this class was generated from the following file:


rosbridge_server
Author(s): Jonathan Mace
autogenerated on Wed Sep 13 2017 03:18:21