We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report
Note lines are being repeated when an error for an incompatible type is raised in certain cases.
Encountered when adding support for mypy v1.16 in typeddjango/django-stubs#2703
Bisected to #18847
To Reproduce
from django.db import models class MyModel(models.Model): char1 = models.CharField(max_length=200, choices="test")
Expected Behavior
$ uvx --python=3.12 --with=django-stubs mypy==1.15 --strict bug.py Installed 9 packages in 71ms bug.py:5: error: Need type annotation for "char1" [var-annotated] bug.py:5: error: Argument "choices" to "CharField" has incompatible type "str"; expected "Iterable[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] | Mapping[Any, Any] | type[Choices] | Callable[[], Iterable[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] | Mapping[Any, Any]] | None" [arg-type] bug.py:5: note: Following member(s) of "str" have conflicts: bug.py:5: note: Expected: bug.py:5: note: def __iter__(self) -> Iterator[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] bug.py:5: note: Got: bug.py:5: note: def __iter__(self) -> Iterator[str] Found 2 errors in 1 file (checked 1 source file)
Actual Behavior
$ uvx --with=django-stubs mypy==1.16 --strict bug.py bug.py:5: error: Need type annotation for "char1" [var-annotated] bug.py:5: error: Argument "choices" to "CharField" has incompatible type "str"; expected "Iterable[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] | Mapping[Any, Any] | type[Choices] | Callable[[], Iterable[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] | Mapping[Any, Any]] | None" [arg-type] bug.py:5: note: Following member(s) of "str" have conflicts: bug.py:5: note: Expected: bug.py:5: note: def __iter__(self) -> Iterator[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] bug.py:5: note: Got: bug.py:5: note: def __iter__(self) -> Iterator[str] bug.py:5: note: Expected: bug.py:5: note: def __iter__(self) -> Iterator[tuple[Any, Any] | tuple[str, Iterable[tuple[Any, Any]]]] bug.py:5: note: Got: bug.py:5: note: def __iter__(self) -> Iterator[str] Found 2 errors in 1 file (checked 1 source file)
Note that the last four "note" lines are repeated.
Your Environment
--strict
mypy.ini
The text was updated successfully, but these errors were encountered:
OK, I think I know what is going on:
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug Report
Note lines are being repeated when an error for an incompatible type is raised in certain cases.
Encountered when adding support for mypy v1.16 in typeddjango/django-stubs#2703
Bisected to #18847
To Reproduce
Expected Behavior
Actual Behavior
Note that the last four "note" lines are repeated.
Your Environment
--strict
mypy.ini
(and other config files): n/aThe text was updated successfully, but these errors were encountered: