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
I'm adding type hints to a rather large Django project with a custom user model, discovered a bug after upgrading to Django 5.1.4.
What's wrong
$ mypy --show-traceback apps/app-name
/usr/local/lib/python3.12/dist-packages/django-stubs/http/request.pyi:58: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.13.0
Traceback (most recent call last):
File "mypy/semanal.py", line 7113, in accept
File "mypy/nodes.py", line 1351, in accept
File "mypy/semanal.py", line 3153, in visit_assignment_stmt
File "mypy/semanal.py", line 3671, in process_type_annotation
File "mypy/semanal.py", line 6767, in defer
AssertionError: Must not defer during final iteration
/usr/local/lib/python3.12/dist-packages/django-stubs/http/request.pyi:58: : note: use --pdb to drop into pdb
How it should be
I've narrowed the problem down to this commit. Prior to that, it did not crash.
Is there any fix to this? If I downgrade django-stubs version all of a sudden I get 51 errors, such as django-stubs\db\models\constraints.pyi:43: note: "CheckConstraint" defined here. But if I try to upgrade I get the same error as you.
Bug report
I'm adding type hints to a rather large Django project with a custom user model, discovered a bug after upgrading to Django 5.1.4.
What's wrong
How it should be
I've narrowed the problem down to this commit. Prior to that, it did not crash.
Then run mypy:
System information
python
version: 3.12django
version: 5.1.4mypy
version: 1.13django-stubs
version: 5.1.0 and higherdjango-stubs-ext
version: 5.1.0 and higherThe text was updated successfully, but these errors were encountered: