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
Argument 1 to "intersection" of "set" has incompatible type "*map[Set[str]]"; expected "Set[_T]" [arg-type]
Your Environment
Mypy version used: 0.991
Mypy command-line flags: --strict (it's present without strict checking as well)
Mypy configuration options from mypy.ini (and other config files): None
Python version used: 3.11
This issue is present for a bunch of other set methods like union and difference (I guess all of them that accept *s: Iterable[T]).
Possibly related #9706.
Activity
Kein commentedon Jan 19, 2023
Same:
randolf-scholz commentedon Aug 3, 2023
Another example (mypy-playground):
pyrightraises no errors, so likely an issue withmypy(and not with stubs).EDIT: It is fixed using the
--new-type-inferenceflag on master branchhttps://mypy-play.net/?mypy=master&python=3.11&gist=95765a01a9543509a1c740f4f9448397&flags=new-type-inference
Molkree commentedon Dec 22, 2024
@randolf-scholz your example raises no errors since mypy 1.7 (released Nov 10, 2023) where new type inference was enabled by default.
My original repro raises no errors since mypy 1.14 (released Dec 19, 2024).
Molkree commentedon Jan 5, 2025
Original repro raises an error once again in mypy 1.14.1
Reason is, mypy stopped raising in 1.14.0 due to a bug (inferring
Anyinstead of a more precise type).So this issue wasn't really fixed, reopening.
Use checkmember.py to check protocol subtyping (python#18943)
Use checkmember.py to check protocol subtyping (python#18943)