Classes | Functions | Variables

Package unlock.util.saferef

Classes

class  BoundMethodWeakref
class  BoundNonDescriptorMethodWeakref

Functions

def safeRef
def get_bound_method_weakref

Variables

string __author__ = 'jpercent'

Detailed Description

"Safe weakrefs", originally from pyDispatcher.

Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).

Function Documentation

def unlock.util.saferef.get_bound_method_weakref (   target,
  onDelete 
)
Instantiates the appropiate BoundMethodWeakRef, depending on the details of
the underlying class method implementation
def unlock.util.saferef.safeRef (   target,
  onDelete = None 
)
Return a *safe* weak reference to a callable target

target -- the object to be weakly referenced, if it's a
    bound method reference, will create a BoundMethodWeakref,
    otherwise creates a simple weakref.
onDelete -- if provided, will have a hard reference stored
    to the callable to be called after the safe reference
    goes out of scope with the reference object, (either a
    weakref or a BoundMethodWeakref) as argument.

Variable Documentation

string unlock::util::saferef.__author__ = 'jpercent'