ST-API-stubs
ST-API-stubs copied to clipboard
How to deal with `Command.description()` with `want_event` is `True`?
With want_event=True, we have something like
def description(self, event: EventDict) -> str: ...
which violates the current stubs
def description(self) -> str: ...
But if we use @overload like the following in our stubs
@overload
def description(self) -> str: ...
@overload
def description(self, event: EventDict) -> str: ...
then it will force users to use the following signature in their implementation
def description(self, event: Optional[EventDict]=None) -> str:
which is annoying and breaks BC.
How do we fix this without using # type: ignore?