brief overview of some of the latest changes and features in Python 3.11:
Time Functions with Nanosecond Resolution: Python 3.11 introduces a new set of time functions with nanosecond resolution. These functions include
time.perf_counter_ns(), time.process_time_ns()
, andtime.monotonic_ns()
.Positional-Only Parameters: Python 3.11 introduces a new syntax for defining positional-only parameters in function definitions. Positional-only parameters are parameters that can only be specified using their position, and not by using their name.
New Dictionary Methods: Python 3.11 introduces several new methods for dictionaries, including
dict.fromkeys_ex()
, which allows you to create a new dictionary with a set of keys and a default value for all of the keys.Improved Error Handling: Python 3.11 includes several improvements to error handling, including the ability to specify a traceback message when raising an exception, and the ability to specify a from_cause parameter when raising an exception from another exception.
Improved Performance: Python 3.11 includes several performance improvements, including faster dict lookups and faster attribute access.
Top comments (0)