You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the type for ct is inferred as expected, but for the app_label field it is not, even though that field is annotated in the stubs. Is this some bug or limitation of the plugin?
How is that should be
The runtime type for ct.app_label is str, so ideally that would be the inferred type.
System information
OS:
python version: 3.10.12
django version: 4.2
mypy version: 1.13.0
django-stubs version: 5.1.1
django-stubs-ext version: 5.1.1
The text was updated successfully, but these errors were encountered:
I could use some hints on where to start looking. Is it expected or unexpected that the type for app_label isn't inferred? And would the solution indeed be to change the plugin?
Bug report
What's wrong
If I run mypy on this code:
It outputs:
In
django-stubs/contrib/contenttypes/models.pyi
, theContentType
class is annotated as follows:So the type for
ct
is inferred as expected, but for theapp_label
field it is not, even though that field is annotated in the stubs. Is this some bug or limitation of the plugin?How is that should be
The runtime type for
ct.app_label
isstr
, so ideally that would be the inferred type.System information
python
version: 3.10.12django
version: 4.2mypy
version: 1.13.0django-stubs
version: 5.1.1django-stubs-ext
version: 5.1.1The text was updated successfully, but these errors were encountered: