Skip to content

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

Closed
@r4you96

Description

@r4you96

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]:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions