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
Yeah, most likely I did this. Any with type narrowing works quite arbitrary (and it was never really consistent). It actually works for flipped order (i.e. if isinstance(other, self.__class__) and other: ...). I will check if it is easy to make it more consistent (or at least return the old behavior) without causing troubles in other places.
I'm already changing my code to use only the isinstance check. The first clause (other) is redundant since None cannot ever pass the isinstance check anyway. Thanks for all of your other work.
Bug Report
Type narrowing using
isinstance
with 1.7 behaves differently from 1.6 for seemingly valid code.To Reproduce
Expected Behavior
The
eq1
andeq2
should both be valid code.eq2
fails under 1.7 but succeeded under 1.6.Actual Behavior
Your Environment
mypy.ini
(and other config files):Python 3.12 macos-arm64
The text was updated successfully, but these errors were encountered: