Module disco :: Class Closure
[hide private]
[frames] | no frames]

Class Closure

source code


A weak reference to a callback with arguments as an object

Weak references to methods immediatly die, even if the object is still alive. Besides a handy way to store a callback, this provides a workaround that keeps a reference to the object instead.

Userargs and removeargs must be tuples.

Instance Methods [hide private]
 
__init__(self, cb, userargs=(), remove=None, removeargs=())
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_remove(self, ref) source code
 
__call__(self, *args, **kwargs) source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cb, userargs=(), remove=None, removeargs=())
(Constructor)

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

_remove(self, ref)

source code 

__call__(self, *args, **kwargs)
(Call operator)

source code