Package harold :: Module callabletools :: Class CallableWrapper
[show private | hide private]
[frames | no frames]

Type CallableWrapper

object --+
         |
        CallableWrapper

Known Subclasses:
method

Base class for wrapping callables.

This class can be used as a base class for wrapping callables (e.g. for writing decorators). It acts as a proxy for usual attributes (__name__, __doc__, __module__, func_name, func_doc) if the wrapped callable has them. All the methods of this module behave well with instances of this class (i.e. they get information from the wrapped callable rather than the __call__ function itself).

Note also that CallableWrappers implement a __get__ method to return a method object, just as functions do, even if the wrapped callable is not a function and has not such method.
Method Summary
  __init__(self, a_callable)
  __call__(self, *args, **kw)
  _get_wrapped(self)
see: wrapped
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  wrapped: Return the callable wrapped by this CallableWrapper

Class Variable Summary
type __get__ = types.instancemethod

Method Details

_get_wrapped(self)

see: wrapped

Property Details

wrapped

Return the callable wrapped by this CallableWrapper
Get Method:
_get_wrapped(self)

Generated by Epydoc 2.1 on Mon Dec 18 15:25:58 2006 http://epydoc.sf.net