-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly
Description
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
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
- Mypy version used: 1.15.0
- Python version used: 3.12
- Whatever mypy playground currently uses by default
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly