redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

Why is the return typing of rpop and lpop command non awaitable type?

Open r4you96 opened this issue 2 years ago • 3 comments
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 avatar Dec 05 '22 07:12 r4you96

@r4you96 Would you be interested in contributing a pull request?

chayim avatar Dec 07 '22 07:12 chayim

It seems to have fixed from #2590

aciddust avatar May 15 '23 08:05 aciddust

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar May 15 '24 00:05 github-actions[bot]