Feature
continue/break/return in except* is a syntax error, see https://peps.python.org/pep-0654/#forbidden-combinations.
def foo():
for _ in range(5):
try:
...
except* Exception:
continue
except* ValueError:
break
except* TypeError:
return
$ mypy --python-version=3.11 foo.py
Success: no issues found in 1 source file
$ mypy --version
mypy 1.13.0 (compiled: yes)
Pitch
mypy does give an error if you try to combine except and except*, and as far as I know it flags all other syntax errors as well, so should probably handle this too. It might also cause users to adjust code to avoid unreachable code needlessly, when in fact they have bigger problems to fix first.
Feature
continue/break/return in except* is a syntax error, see https://peps.python.org/pep-0654/#forbidden-combinations.
Pitch
mypy does give an error if you try to combine
exceptandexcept*, and as far as I know it flags all other syntax errors as well, so should probably handle this too. It might also cause users to adjust code to avoidunreachable codeneedlessly, when in fact they have bigger problems to fix first.