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
Fixes#18514.
Only `try` clause should be treated as fallible, this should not prevent
`--allow-redefinition` from working in other try clauses (except, else,
finally).
Fixespython#18514.
Only `try` clause should be treated as fallible, this should not prevent
`--allow-redefinition` from working in other try clauses (except, else,
finally).
Bug Report
To Reproduce
https://mypy-play.net/?mypy=1.13.0&python=3.13&flags=allow-redefinition&gist=62f6a12961c14755216efcd52137fee0
Expected Behavior
No type errors should be reported when running
mypy --allow-redefinition
.Actual Behavior
An error is reported after the redefinition of
x
in theelse
branch of thetry
statement even thoughquoting the documentation.
The redefinition in the
else
branch of anif
statement is accepted as documented.Your Environment
--allow-redefinition
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: