def METHOD_NAME(
    self, listener: EventHandler, eventType: Optional[str] = None
):
    """
    Subscribes `listener` to events fired by this object. If `eventType` is
    not `None` then `listener` will only receive events of `eventType` that
    originate from this object, otherwise it will receive all events.
    """
    # logger.debug(
    #     "Adding listener to %r eventType=%s: %r",
    #     self,
    #     eventType,
    #     listener,
    # )
    eventType = eventType or EventFirer.__ALL_EVENTS
    self._listeners[eventType].append(listener)