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
The "return" not allowed in except* block [misc] check introduced in #18123 triggers when a lambda is defined inside an except* block. It does not trigger on nested functions defined in the same place.
I expect mypy to not complain about the presence of return statements if a lambda is present in an except* block.
Actual Behavior
main.py:6: error: "return" not allowed in except* block [misc]
main.py:9: error: "return" not allowed in except* block [misc]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.15.0
Python version used: 3.12
Whatever mypy playground currently uses by default
The text was updated successfully, but these errors were encountered:
Bug Report
The
"return" not allowed in except* block [misc]
check introduced in #18123 triggers when a lambda is defined inside an except* block. It does not trigger on nested functions defined in the same place.To Reproduce
mypy playground
Expected Behavior
I expect mypy to not complain about the presence of return statements if a lambda is present in an except* block.
Actual Behavior
main.py:6: error: "return" not allowed in except* block [misc]
main.py:9: error: "return" not allowed in except* block [misc]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
The text was updated successfully, but these errors were encountered: