Here are some of the new features in Python 3.11:
- Fine-grained error locations in tracebacks. Python 3.11 now provides more information about the location of errors in tracebacks. This can help you to quickly identify the source of an error and fix it.
- Exception Groups and except*. Python 3.11 introduces Exception Groups and
exceptsyntax. Exception Groups allow you to handle multiple exceptions with a single except clause. The
exceptsyntax allows you to handle all exceptions with a single
- New Features Related to Type Hints. Python 3.11 introduces a number of new
features related to type hints. These features include:
- Variadic generics.
- Marking individual TypedDict items as required or not-required.
- Arbitrary literal string type.
- Data class transforms.
- Other Language Changes. Python 3.11 also includes a number of other language
changes, such as:
- Support for TOML configuration parsing.
- Faster CPython.
- Faster Startup.
- Frozen imports / Static code objects.
- CPython bytecode changes.
- New opcodes.
- Deprecated. Python 3.11 deprecates a number of features, such as:
withstatement with a bare string.
yieldfrom expression with a bare string.
yieldexpression with a bare string.
I hope this helps!