Closed vvanglro closed 1 year ago
I found in the latest pycharm that there is this wrong type hint:
While I'm investigating it turns out this is a problem with pycharm. pycharm issue1 pycharm issue2
This is not very friendly for pycharm users, so I wonder if we can do some patch to make the prompt more friendly before pycharm fixes support, or not doing it. like using:
@overload
async def subscribe(
self,
topic: SubscribeTopic,
qos: int = 0,
options: mqtt.SubscribeOptions | None = None,
properties: Properties | None = None,
*args: Any,
timeout: int = 10,
**kwargs: Any,
) -> tuple[int] | list[mqtt.ReasonCodes]:
Yes, derived classes of Client are supported.
LGTM! Cheers. :) Thank you for your contribution to asyncio-mqtt. :+1:
Regarding the pycharm issue: I'm open to workarounds. Your @overload
-based workaround is a bit too much for me (defeats the DRY principle). Any other suggestions? :)
Great PR! Thanks
better type hints.