class documentation

Mirror the event listening definitions of an Events class with listener collections. Classes which define a "dispatch" member will return a non-instantiated :class:`._Dispatch` subclass when the member is accessed at the class level. When the "dispatch" member is accessed at the instance level of its owner, an instance of the :class:`._Dispatch` class is returned. A :class:`._Dispatch` class is generated for each :class:`.Events` class defined, by the :meth:`._HasEventsDispatch._create_dispatcher_class` method. The original :class:`.Events` classes remain untouched. This decouples the construction of :class:`.Events` subclasses from the implementation used by the event internals, and allows inspecting tools like Sphinx to work in an unsurprising way against the public API.

Method __getattr__ Undocumented
Method __init__ Undocumented
Method __reduce__ Undocumented
Class Variable __slots__ Undocumented
Method _clear Undocumented
Method _for_class Undocumented
Method _for_instance Undocumented
Method _join Create a 'join' of this :class:`._Dispatch` and another.
Method _listen Undocumented
Method _update Populate from the listeners in another :class:`_Dispatch` object.
Class Variable _active_history Undocumented
Class Variable _empty_listener_reg Undocumented
Class Variable _event_names Undocumented
Class Variable _events reference back to the Events class.
Class Variable _joined_dispatch_cls Undocumented
Instance Variable _empty_listeners Undocumented
Instance Variable _instance_cls Undocumented
Instance Variable _parent Undocumented
Property _event_descriptors Undocumented
def __init__(self, parent: Optional[_Dispatch[_ET]], instance_cls: Optional[Type[_ET]] = None): (source)

Undocumented

def __reduce__(self) -> Union[str, Tuple[Any, ...]]: (source)

Undocumented

def _clear(self): (source)

Undocumented

def _for_class(self, instance_cls: Type[_ET]) -> _Dispatch[_ET]: (source)

Undocumented

def _for_instance(self, instance: _ET) -> _Dispatch[_ET]: (source)

Undocumented

Create a 'join' of this :class:`._Dispatch` and another. This new dispatcher will dispatch events to both :class:`._Dispatch` objects.

def _listen(self, event_key: _EventKey[_ET], **kw: Any): (source)

Undocumented

def _update(self, other: _Dispatch[_ET], only_propagate: bool = True): (source)

Populate from the listeners in another :class:`_Dispatch` object.

_active_history: bool = (source)

Undocumented

Undocumented

_event_names: List[str] = (source)

Undocumented

reference back to the Events class. Bidirectional against _HasEventsDispatch.dispatch

_joined_dispatch_cls: Type[_JoinedDispatcher[_ET]] = (source)

Undocumented

_empty_listeners = (source)

Undocumented

Undocumented

Undocumented