Electroneum
Classes | Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
py2backports.weakref.finalize Class Reference
Inheritance diagram for py2backports.weakref.finalize:
Inheritance graph
[legend]
Collaboration diagram for py2backports.weakref.finalize:
Collaboration graph
[legend]

Classes

class  _Info
 

Public Member Functions

def __init__ (self, obj, func, *args, **kwargs)
 
def __call__ (self, _=None)
 
def detach (self)
 
def peek (self)
 
def alive (self)
 
def atexit (self)
 
def atexit (self, value)
 
def __repr__ (self)
 

Private Member Functions

def _select_for_exit (cls)
 
def _exitfunc (cls)
 

Static Private Attributes

tuple __slots__ = ()
 
dictionary _registry = {}
 
bool _shutdown = False
 
 _index_iter = itertools.count()
 
bool _dirty = False
 
bool _registered_with_atexit = False
 

Detailed Description

Class for finalization of weakrefable objects
finalize(obj, func, *args, **kwargs) returns a callable finalizer
object which will be called when obj is garbage collected. The
first time the finalizer is called it evaluates func(*arg, **kwargs)
and returns the result. After this the finalizer is dead, and
calling it just returns None.
When the program exits any remaining finalizers for which the
atexit attribute is true will be run in reverse order of creation.
By default atexit is true.

Constructor & Destructor Documentation

◆ __init__()

def py2backports.weakref.finalize.__init__ (   self,
  obj,
  func,
args,
**  kwargs 
)

Member Function Documentation

◆ __call__()

def py2backports.weakref.finalize.__call__ (   self,
  _ = None 
)
If alive then mark as dead and return func(*args, **kwargs);
otherwise return None

◆ __repr__()

def py2backports.weakref.finalize.__repr__ (   self)

◆ _exitfunc()

def py2backports.weakref.finalize._exitfunc (   cls)
private

◆ _select_for_exit()

def py2backports.weakref.finalize._select_for_exit (   cls)
private

◆ alive()

def py2backports.weakref.finalize.alive (   self)
Whether finalizer is alive

◆ atexit() [1/2]

def py2backports.weakref.finalize.atexit (   self)
Whether finalizer should be called at exit

◆ atexit() [2/2]

def py2backports.weakref.finalize.atexit (   self,
  value 
)

◆ detach()

def py2backports.weakref.finalize.detach (   self)
If alive then mark as dead and return (obj, func, args, kwargs);
otherwise return None

◆ peek()

def py2backports.weakref.finalize.peek (   self)
If alive then return (obj, func, args, kwargs);
otherwise return None

Member Data Documentation

◆ __slots__

tuple py2backports.weakref.finalize.__slots__ = ()
staticprivate

◆ _dirty

bool py2backports.weakref.finalize._dirty = False
staticprivate

◆ _index_iter

py2backports.weakref.finalize._index_iter = itertools.count()
staticprivate

◆ _registered_with_atexit

bool py2backports.weakref.finalize._registered_with_atexit = False
staticprivate

◆ _registry

dictionary py2backports.weakref.finalize._registry = {}
staticprivate

◆ _shutdown

bool py2backports.weakref.finalize._shutdown = False
staticprivate

The documentation for this class was generated from the following file: