redis-py
redis-py copied to clipboard
Why is the return typing of rpop and lpop command non awaitable type?
trafficstars
Version: 4.4.0
Platform: Ubuntu 18.04 / Python 3.9.13
Description: I'm using list commands with redis-py. Among them, I often using rpop, lpop.
I expected that commands return typing is awaitable object typing, but there is static typing. Because of this, myide displays warning.
that can be modified?
Now
def rpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]:
...
def lpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]:
...
I want
def rpop(self, name: str, count: Optional[int] = None) -> Union[Awaitable[str, List, None], str, List, None]:
...
def lpop(self, name: str, count: Optional[int] = None) -> Union[Awaitable[str, List, None], str, List, None]:
...
@r4you96 Would you be interested in contributing a pull request?
It seems to have fixed from #2590
This issue is marked stale. It will be closed in 30 days if it is not updated.