Python 3.14 introduces a syntax update that allows handling multiple exceptions in try-except blocks without requiring parentheses around the exception types. Previously, catching multiple exceptions like ValueError and TypeError required wrapping them in parentheses: except (ValueError, TypeError). The new syntax allows except ValueError, TypeError without parentheses, making it more consistent with other Python constructs like tuple definitions. However, this new syntax doesn't support the 'as e' clause for accessing error information, which maintains clarity. The change is outlined in PEP 758 and aims to improve simplicity, readability, and consistency across the language.
•6m watch time
Sort: