Skip to content

Make as_manager() in queryset generic instead of using AnyΒ #324

@silviogutierrez

Description

@silviogutierrez

Bug report

What's wrong

as_manager() on querysets currently uses Any instead of _T.

Like so:

# django-stubs/db/models/query.pyi
    @classmethod
    def as_manager(cls) -> Manager[Any]: ...

How is that should be

Looks like a simple switch to _T fixes it:

# django-stubs/db/models/query.pyi
    @classmethod
    def as_manager(cls) -> Manager[_T]: ...

See https://docs.djangoproject.com/en/3.0/topics/db/managers/#creating-a-manager-with-queryset-methods for more info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions