class documentation

class EventData:

View In Hierarchy

Event data class. This class is used to pass data to event handlers.

Method __getitem__ Get an item from the payload if it is a tuple.
Method __len__ Get the length of the payload if it is a tuple.
Class Variable name The event name.
Class Variable payload The event payload.
def __getitem__(self, key: int) -> Any:

Get an item from the payload if it is a tuple.

Parameters
key:intThe index of the item to get from the payload.
Returns
AnyThe item at the specified index in the payload.
Raises
TypeErrorIf the payload is not a tuple.
def __len__(self) -> int:

Get the length of the payload if it is a tuple.

Returns
intThe length of the payload if it is a tuple.
Raises
TypeErrorIf the payload is not a tuple.
name: str | None =

The event name.

payload: Any | tuple =

The event payload.