Package SCons :: Module Environment :: Class MethodWrapper
[hide private]
[frames] | no frames]

Class MethodWrapper

source code

object --+
         |
        MethodWrapper
Known Subclasses:

A generic Wrapper class that associates a method (which can actually be any callable) with an object. As part of creating this MethodWrapper object an attribute with the specified (by default, the name of the supplied method) is added to the underlying object. When that new "method" is called, our __call__() method adds the object as the first argument, simulating the Python behavior of supplying "self" on method calls.

We hang on to the name by which the method was added to the underlying base class so that we can provide a method to "clone" ourselves onto a new underlying object being copied (without which we wouldn't need to save that info).

Instance Methods [hide private]
 
__init__(self, object, method, name=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__call__(self, *args, **kwargs) source code
 
clone(self, new_object)
Returns an object that re-binds the underlying "method" to the specified new object.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, object, method, name=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)