-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Question] What is an alternative to isinstance(obj, QuerySet)? #704
Comments
This is because We can try to alias it as @MT-Cash can you please try that? |
From where should I import |
You cannot import It might help. |
Kinda stumbled over the same issue and can confirm, that removing Created PR #794. |
This also re-export `QuerySetAny` for external access to nongeneric QuerySet. The approach taken here is making `_QuerySetAny` an alias of `_QuerySet[_T, _T]` dedicated for isinstance checks, and leave `QuerySet` unchanged as the type alias of `_QuerySet[_T, _T]`. Fixes typeddjango#704. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This also re-export `QuerySetAny` for external access to nongeneric QuerySet. The approach taken here is making `_QuerySetAny` an alias of `_QuerySet[_T, _T]` dedicated for isinstance checks, and leave `QuerySet` unchanged as the type alias of `_QuerySet[_T, _T]`. Fixes typeddjango#704. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This also re-export `QuerySetAny` for external access to nongeneric QuerySet. The approach taken here is making `_QuerySetAny` an alias of `_QuerySet[_T, _T]` dedicated for isinstance checks, and leave `QuerySet` unchanged as the type alias of `_QuerySet[_T, _T]`. Fixes typeddjango#704. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This also re-export `QuerySetAny` for external access to nongeneric QuerySet. The approach taken here is making `_QuerySetAny` an alias of `_QuerySet[_T, _T]` dedicated for isinstance checks, and leave `QuerySet` unchanged as the type alias of `_QuerySet[_T, _T]`. Fixes #704. Signed-off-by: Zixuan James Li <p359101898@gmail.com> Signed-off-by: Zixuan James Li <p359101898@gmail.com>
I've recently got
with
django-stubs==1.9.0
forisinstance(obj, QuerySet)
when I run mypy over the code.What is the recommended way to do it?
The text was updated successfully, but these errors were encountered: