Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
r4you96 opened this issue Dec 5, 2022 · 2 comments
Open
Labels
bug Bug

Comments

@r4you96
Copy link

r4you96 commented Dec 5, 2022

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]:
    ...
@chayim
Copy link
Contributor

chayim commented Dec 7, 2022

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

@chayim chayim added the bug Bug label Dec 7, 2022
@aciddust
Copy link
Contributor

aciddust commented May 15, 2023

It seems to have fixed from #2590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants