This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Henry Schreiner
Recipients Henry Schreiner
Date 2022-03-09.17:49:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In 3.10 via PEP 604, there was an attempt to use the new union of types where runtime types were previously expected to be a tuple. `isinstance(x, (A, B))` can be written `isinstance(x, A | B)`. Unfortunately, there still is a case were a tuple of types is required: `except (A, B) as err:` cannot be written `except A | B as err:`. I think this should be allowed; it is consistent with isinstance and pattern matching's use of |, and nicely avoids confusion with `except A, B:` which is disallowed for Python 2 reasons; `except A | B`: would be valid.
Date User Action Args
2022-03-09 17:49:02Henry Schreinersetrecipients: + Henry Schreiner
2022-03-09 17:49:02Henry Schreinersetmessageid: <>
2022-03-09 17:49:02Henry Schreinerlinkissue46967 messages
2022-03-09 17:49:02Henry Schreinercreate