Monero
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Static Protected Attributes | 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)
 

Protected Member Functions

def _select_for_exit (cls)
 
def _exitfunc (cls)
 

Static Protected Attributes

dict _registry = {}
 
bool _shutdown = False
 
itertools _index_iter = itertools.count()
 
bool _dirty = False
 
bool _registered_with_atexit = False
 

Static Private Attributes

tuple __slots__ = ()
 

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)
protected

◆ _select_for_exit()

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

◆ 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
staticprotected

◆ _index_iter

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

◆ _registered_with_atexit

bool py2backports.weakref.finalize._registered_with_atexit = False
staticprotected

◆ _registry

dict py2backports.weakref.finalize._registry = {}
staticprotected

◆ _shutdown

bool py2backports.weakref.finalize._shutdown = False
staticprotected

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