Skip to content

redis.asyncio.client.Redis.ping type error introduced in 7.0 #3920

@tjkuson

Description

@tjkuson

To reproduce, install redis and run a type-checker on the following snippet:

from redis.asyncio import Redis

async def main() -> None:
    r = Redis()
    await r.ping()

Both the latest versions of mypy and ty report a type error due to the return value of the ping method being Awaitable[bool] | bool. The expected behaviour is that the above snippet passes type checks.

This is a type regression introduced in #3789.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions