Skip to content

[Question] What is an alternative to isinstance(obj, QuerySet)? #704

Closed
@martin-thoma

Description

@martin-thoma

I've recently got

Parameterized generics cannot be used with class or instance checks

with django-stubs==1.9.0 for isinstance(obj, QuerySet) when I run mypy over the code.

What is the recommended way to do it?

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