Avoid overriding AttributeError
metadata information for nested attribute access calls. Patch by Pablo Galindo.
Include the type's name in the error message for subscripting non-generic types.
Support vectorcall for super()
. Patch by Ken Jin.
Fix incorrect handling of inline cache entries when specializing BINARY_OP
.
Use an oparg to simplify the construction of helpful error messages in GET_AWAITABLE
.
Make sure that str subclasses can be used as attribute names for instances with virtual dictionaries. Fixes regression in 3.11alpha
Add more detailed specialization failure stats for COMPARE_OP
followed by EXTENDED_ARG
.
Fix bug introduced during 3.11alpha where subclasses of types.ModuleType
with __slots__
were not initialized correctly, resulting in an interpreter crash.
Use inline caching for LOAD_ATTR
, LOAD_METHOD
, and STORE_ATTR
.
Use inline cache for BINARY_SUBSCR
.
Use inline caching for COMPARE_OP
.
Deprecate PyBytesObject.ob_shash
. It will be removed in Python 3.13.
Use inline caching for UNPACK_SEQUENCE
.
Reduces dict size by removing hash value from hash table when all inserted keys are Unicode. For example, sys.getsizeof(dict.fromkeys("abcdefg"))
becomes 272 bytes from 352 bytes on 64bit platform.
Use inline cache for LOAD_GLOBAL
.
Rename the private undocumented float.__set_format__()
method to float.__setformat__()
to fix a typo introduced in Python 3.7. The method is only used by test_float. Patch by Victor Stinner.
Remove the undocumented private float.__set_format__()
method, previously known as float.__setformat__()
in Python 3.7. Its docstring said: "You probably don't want to use this function. It exists mainly to be used in Python's test suite." Patch by Victor Stinner.
Fix regression that dict.update(other) may don't respect iterate order of other when other is key sharing dict.
Share global string identifiers in deep-frozen modules.
Fix memory leak in interned strings of deep-frozen modules.
Store BINARY_OP
caches inline using a new CACHE
instruction.
Specialize LOAD_METHOD
for instances with a dict.
Reduce the memory usage of specialized LOAD_ATTR
and STORE_ATTR
instructions.
Add number of sub-exceptions to BaseException.__str__
.
Don't un-adapt COMPARE_OP
when collecting specialization stats.
Fix specialization stats gathering for !PRECALL
instructions.
Bump up the libexpat version into 2.4.6
Implement a specialized combined opcode LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE
. Patch by Dennis Sweeney.
Fix parsing a numeric literal immediately (without spaces) followed by "not in" keywords, like in 1not in x
. Now the parser only emits a warning, not a syntax error.
Move KW_NAMES
before PRECALL
instruction in call sequence. Change operand
of CALL
to match PRECALL
for easier specialization.
Remove the NEXT_BLOCK
macro from compile.c, and make the compiler automatically generate implicit blocks when they are needed.
Add PUSH_NULL
instruction. This is used as a prefix when evaluating a callable, so that the stack has the same shape for methods and other calls. PRECALL_FUNCTION
and PRECALL_METHOD
are merged into a single PRECALL
instruction.
There is no change in semantics.
Fix an assert failure in debug builds when a '<', '>', or '=' is the last character in an f-string that's missing a closing right brace.
Message of AttributeError caused by getting, setting or deleting a property without the corresponding function now mentions that the attribute is in fact a property and also specifies type of the class that it belongs to.
Make sure that all backwards jumps use the JUMP_ABSOLUTE
instruction, rather than JUMP_FORWARD
with an argument of (2**32)+offset
.
Correct the docstring for the ~object.__bool__
method. Patch by Jelle Zijlstra.
Add more detailed specialization failure statistics for BINARY_OP
.
Avoid potential exponential backtracking when producing some syntax errors involving lots of brackets. Patch by Pablo Galindo.
ctypes
now allocates memory on the stack instead of on the heap to pass arguments while calling a Python callback function. Patch by Donghee Na.
Add a quickened form of RESUME
that skips quickening checks.
Specialize UNPACK_SEQUENCE
for tuple
and list
unpackings.
Opcode pair stats are now gathered with --enable-pystats
. Defining DYNAMIC_EXECUTION_PROFILE
or DXPAIRS
no longer has any effect.
Allow more than 16 items in a split dict before it is combined. The limit is now 254.
Add a missing call to va_end()
in Modules/_hashopenssl.c
.
Use :cPyObject_Vectorcall
while calling ctypes callback function. Patch by Donghee Na.
When iterating over sets internally in setobject.c
, acquire strong references to the resulting items from the set. This prevents crashes in corner-cases of various set operations where the set gets mutated.
The bytecode compiler now attempts to apply runtime stack manipulations at compile-time (whenever it is feasible to do so).
Fixed a minor portability issue in the implementation of :cPyLong_FromLong
, and added a fast path for single-digit integers to :cPyLong_FromLongLong
.
Fixed a file leak in xml.etree.ElementTree.iterparse
when the iterator is not exhausted. Patch by Jacob Walls.
Export unittest.doModuleCleanups
in unittest
. Patch by Kumar Aditya.
For performance, use the optimized string-searching implementations from ~bytes.find
and ~bytes.rfind
for ~mmap.find
and ~mmap.rfind
.
~http.server.SimpleHTTPRequestHandler
now uses HTML5 grammar. Patch by Donghee Na.
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport
.
Support UDP sockets in asyncio.loop.sock_connect
for selector-based event loops. Patch by Thomas Grainger.
Make test suite support Expat >=2.4.5
Raise TypeError
if ssl.SSLSocket
is passed to transport-based APIs.
Fix libexpat symbols collisions with user dynamically loaded or statically linked libexpat in embedded Python.
The HTML serialisation in xml.etree.ElementTree now writes embed
, source
, track
and wbr
as empty tags, as defined in HTML 5.
shutil.rmtree
can now work with VirtualBox shared folders when running from the guest operating-system.
Propagate asyncio.CancelledError
message from inner task to outer awaiter.
Fix a bug in urllib.request.HTTPPasswordMgr.find_user_password
and urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated
which allowed to bypass authorization. For example, access to URI example.org/foobar
was allowed if the user was authorized for URI example.org/foo
.
random.gauss
and random.normalvariate
now have default arguments.
Add task groups to asyncio (structured concurrency, inspired by Trio's nurseries). This also introduces a change to task cancellation, where a cancelled task can't be cancelled again until it calls .uncancel().
Fix dis
behavior on negative jump offsets.
The __repr__
method of typing.ForwardRef
now includes the module
parameter of typing.ForwardRef
when it is set.
In typing.get_type_hints
, support evaluating stringified ParamSpecArgs
and ParamSpecKwargs
annotations. Patch by Gregory Beauregard.
When the tarfile
module creates a pax format archive, it will put an integer representation of timestamps in the ustar header (if possible) for the benefit of older unarchivers, in addition to the existing full-precision timestamps in the pax extended header.
Deprecate kwargs-based syntax for typing.TypedDict
definitions. It had confusing semantics when specifying totality, and was largely unused. Patch by Jingchen Ye.
Make typing.ParamSpec
args and kwargs equal to themselves. Patch by Gregory Beauregard.
ctypes.CFUNCTYPE()
and ctypes.WINFUNCTYPE()
now fail to create the type if its _argtypes_
member contains too many arguments. Previously, the error was only raised when calling a function. Patch by Victor Stinner.
Fix NameError
in asyncio.gather
when initial type check fails.
The calendar.LocaleTextCalendar
and calendar.LocaleHTMLCalendar
classes now use locale.getlocale
, instead of using locale.getdefaultlocale
, if no locale is specified. Patch by Victor Stinner.
The locale.getdefaultlocale
function is deprecated and will be removed in Python 3.13. Use locale.setlocale
, locale.getpreferredencoding(False) <locale.getpreferredencoding>
and locale.getlocale
functions instead. Patch by Victor Stinner.
In typing.get_type_hints
, support evaluating bare stringified TypeAlias
annotations. Patch by Gregory Beauregard.
Fixed a discrepancy in the C implementation of the xml.etree.ElementTree
module. Now, instantiating an xml.etree.ElementTree.XMLParser
with a target=None
keyword provides a default xml.etree.ElementTree.TreeBuilder
target as the Python implementation does.
Expose Linux's IP_BIND_ADDRESS_NO_PORT
option in socket
.
Fix a bug in the codeop
module that was incorrectly identifying invalid code involving string quotes as valid code.
Improve typing.no_type_check
.
Now it does not modify external classes and functions. We also now correctly mark classmethods as not to be type checked.
expat: Update libexpat from 2.4.1 to 2.4.4
Deprecate undocumented support for using a pathlib.Path
object as a context manager.
Implement 673
typing.Self
. Patch by James Hilton-Balfe.
Make various module __getattr__
AttributeErrors more closely match a typical AttributeError
Add typing.Never
and typing.assert_never
. Patch by Jelle Zijlstra.
The __eq__
and __hash__
methods of typing.ForwardRef
now honor the module
parameter of typing.ForwardRef
. Forward references from different modules are now differentiated.
Add missing __slots__
to importlib.metadata.DeprecatedList
. Patch by Arie Bovenberg.
The ssl
module now handles certificates with bit strings in DN correctly.
typing.get_type_hints
no longer adds Optional
to parameters with None
as a default. This aligns to changes to PEP 484 in python/peps#689
Add ~re.RegexFlag
to re.__all__
and documented it. Add ~re.RegexFlag.NOFLAG
to indicate no flags being set.
ctypes
no longer defines ffi_type_*
symbols in cfield.c
. The symbols have been provided by libffi for over a decade.
Calling operator.itemgetter
objects and operator.attrgetter
objects is now faster due to use of the vectorcall calling convention.
Fix an issue with ~tarfile.is_tarfile
method when using fileobj argument: position in the fileobj was advanced forward which made it unreadable with tarfile.TarFile.open
.
Reimplement SSL/TLS support in asyncio, borrow the implementation from uvloop library.
Make the configparser.ConfigParser
constructor raise TypeError
if the interpolation
parameter is not of type !configparser.Interpolation
Implement inspect.ismethodwrapper
and fix inspect.isroutine
for cases where methodwrapper is given. Patch by Hakan Çelik.
argparse.FileType now supports an argument of '-' in binary mode, returning the .buffer attribute of sys.stdin/sys.stdout as appropriate. Modes including 'x' and 'a' are treated equivalently to 'w' when argument is '-'. Patch contributed by Josh Rosenberg
Doc/tools/rstlint.py
has moved to its own repository and is now packaged on PyPI as sphinx-lint
.
Fix test_faulthandler.test_sigfpe() if Python is built with undefined behavior sanitizer (UBSAN): disable UBSAN on the faulthandler_sigfpe() function. Patch by Victor Stinner.
Remove bytecode offsets from expected values in test.test_dis module. Reduces the obstacles to modifying the VM or compiler.
Prevent default asyncio event loop policy modification warning after test_asyncio
execution.
The function make_legacy_pyc
in Lib/test/support/import_helper.py
no longer fails when PYTHONPYCACHEPREFIX
is set to a directory on a different device from where tempfiles are stored.
Skip test_pair() and test_speech128() of test_zlib on s390x since they fail if zlib uses the s390x hardware accelerator. Patch by Victor Stinner.
Respect --with-suffix
when building on case-insensitive file systems.
Building Python now requires a C11 compiler. Optional C11 features are not required. Patch by Victor Stinner.
Building Python now requires support for floating point Not-a-Number (NaN): remove the Py_NO_NAN
macro. Patch by Victor Stinner.
Building Python now requires a C99 <math.h>
header file providing a NAN
constant, or the __builtin_nan()
built-in function. Patch by Victor Stinner.
Exclude marshalled-frozen data if deep-freezing to save 300 KB disk space. This includes adding a new is_package
field to :c_frozen
. Patch by Kumar Aditya.
Fix wasm32-emscripten test failures and platform issues. - Disable syscalls that are not supported or don't work, e.g. wait, getrusage, prlimit, mkfifo, mknod, setres[gu]id, setgroups. - Use fd_count to cound open fds. -Add more checks for subprocess and fork. - Add workarounds for missing _multiprocessing and failing socket.accept(). - Enable bzip2. - Disable large file support. - Disable signal.alarm.
Intern strings in deep-frozen modules. Patch by Kumar Aditya.
The default all users install directory for ARM64 is now under the native Program Files
folder, rather than Program Files (Arm)
which is intended for ARM (32-bit) files.
Adds Tcl and Tk support for Windows ARM64. This also adds IDLE to the installation.
Ensures registry virtualization is consistently disabled. For 3.10 and earlier, it remains enabled (some registry writes are protected), while for 3.11 and later it is disabled (registry modifications affect all applications).
Make query dialogs on Windows start with a cursor in the entry box.
Apply IDLE syntax highlighting to .pyi
files. Patch by Alex Waygood and Terry Jan Reedy.
Python's public headers no longer import <stdbool.h>
, leaving code that embedd/extends Python free to define bool
, true
and false
.
Move the :cPyFrameObject
type definition (struct _frame
) to the internal C API pycore_frame.h
header file. Patch by Victor Stinner.
Rename Include/buffer.h
header file to Include/pybuffer.h
to avoid conflits with projects having an existing buffer.h
header file. Patch by Victor Stinner.
Remove the HAVE_PY_SET_53BIT_PRECISION
macro (moved to the internal C API). Patch by Victor Stinner.
Added function :cPyType_GetModuleByDef
, which allows accesss to module state when a method's defining class is not available.