We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report
If we use Union of exception types inside Tuple as a variable in an except clause, mypy produces a false-positive error. Relates to #2816
To Reproduce
def handle(err: tuple[type[ValueError] | type[TypeError], ...]): try: return None except err: # error pass
Gist URL: https://gist.github.com/mypy-play/dd08b2806979cb4b7228e7565046f675 Playground URL: https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=dd08b2806979cb4b7228e7565046f675
Expected Behavior No error.
Actual Behavior
main.py:4: error: Exception type must be derived from BaseException (or be a tuple of exception classes) [misc]
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
If we use Union of exception types inside Tuple as a variable in an except clause, mypy produces a false-positive error.
Relates to #2816
To Reproduce
Gist URL: https://gist.github.com/mypy-play/dd08b2806979cb4b7228e7565046f675
Playground URL: https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=dd08b2806979cb4b7228e7565046f675
Expected Behavior
No error.
Actual Behavior
Your Environment
mypy.ini
(and other config files): -The text was updated successfully, but these errors were encountered: