module documentation

Provides managed registration services on behalf of :func:`.listen` arguments. By "managed registration", we mean that event listening functions and other objects can be added to various collections in such a way that their membership in all those collections can be revoked at once, based on an equivalent :class:`._EventKey`.

Class EventTarget represents an event target, that is, something we can listen on either with that target as a class or as an instance.
Class _EventKey Represent :func:`.listen` arguments.
Function _clear Undocumented
Function _collection_gced Undocumented
Function _removed_from_collection Undocumented
Function _stored_in_collection Undocumented
Function _stored_in_collection_multi Undocumented
Type Variable _ET Undocumented
Type Alias _EventKeyTupleType Undocumented
Type Alias _ListenerFnKeyType Undocumented
Type Alias _ListenerFnType Undocumented
Type Alias _ListenerToEventKeyType Undocumented
Type Alias _RefCollectionToListenerType Undocumented
Variable _collection_to_key Given a _ListenerCollection or _ClsLevelListener, can locate all the original listen() arguments and the listener fn contained
Variable _key_to_collection Given an original listen() argument, can locate all listener collections and the listener fn contained
def _clear(owner: RefCollection[_ET], elements: Iterable[_ListenerFnType]): (source)

Undocumented

def _collection_gced(ref: weakref.ref[Any]): (source)

Undocumented

def _removed_from_collection(event_key: _EventKey[_ET], owner: RefCollection[_ET]): (source)

Undocumented

def _stored_in_collection(event_key: _EventKey[_ET], owner: RefCollection[_ET]) -> bool: (source)

Undocumented

def _stored_in_collection_multi(newowner: RefCollection[_ET], oldowner: RefCollection[_ET], elements: Iterable[_ListenerFnType]): (source)

Undocumented

Undocumented

Value
TypeVar('_ET',
        bound='EventTarget')
_EventKeyTupleType = (source)

Undocumented

Value
Tuple[int, str, _ListenerFnKeyType]
_ListenerFnKeyType = (source)

Undocumented

Value
Union[int, Tuple[int, int]]
_ListenerFnType = (source)

Undocumented

Value
Callable[..., Any]
_ListenerToEventKeyType = (source)

Undocumented

Value
Dict['weakref.ref[_ListenerFnType]', _EventKeyTupleType]
_RefCollectionToListenerType = (source)

Undocumented

Value
Dict['weakref.ref[RefCollection[Any]]', 'weakref.ref[_ListenerFnType]']

Given a _ListenerCollection or _ClsLevelListener, can locate all the original listen() arguments and the listener fn contained ref(listenercollection) -> { ref(listener_fn) -> (target, identifier, fn), ref(listener_fn) -> (target, identifier, fn), ref(listener_fn) -> (target, identifier, fn), }

Given an original listen() argument, can locate all listener collections and the listener fn contained (target, identifier, fn) -> { ref(listenercollection) -> ref(listener_fn) ref(listenercollection) -> ref(listener_fn) ref(listenercollection) -> ref(listener_fn) }