enigma2
2.6
|
Public Member Functions | |
def | __init__ (self, function=None) |
def | __call__ (self, *args, **kwargs) |
def | is_dead (self) |
def | is_alive (self) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
Stores a reference to an object's method or a function. This class also provides comparison operators to allow proper usage in containers such as set([]). The ability to change the weak reference is not supported to prevent mutability. This is important for container support as the object hash would change after storing it.
def enigma.WeakMethodReference.__init__ | ( | self, | |
function = None |
|||
) |
Initialises the weak reference with a function or class method.
def enigma.WeakMethodReference.__call__ | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
@return Calls a new bound-method like the original, or the original function if refers just to a function or unbound method and returns its result. Returns None if the original object doesn't exist
def enigma.WeakMethodReference.__eq__ | ( | self, | |
other | |||
) |
Enables comparison between different weak pointer objects that point to the same object based on the contents instead of the object pointer.
def enigma.WeakMethodReference.__hash__ | ( | self | ) |
this method is provided to allow comparison of references inside of containers like set([]) http://stackoverflow.com/questions/3942303/how-does-a-python-set-check-if-two-objects-are-equal-what-methods-does-an-o
def enigma.WeakMethodReference.__ne__ | ( | self, | |
other | |||
) |
Enables comparison between different weak pointer objects that point to the same object based on the contents instead of the object pointer.
def enigma.WeakMethodReference.is_alive | ( | self | ) |
The equivalent to 'not is_dead()' Make a positive method call because double negatives suck
def enigma.WeakMethodReference.is_dead | ( | self | ) |
Returns True if the referenced callable was a bound method and the instance no longer exists. Otherwise, return False.