Windows
bpo-47194 [https://bugs.python.org/issue?@action=redirect&bpo=47194]: Update
zlib
to v1.2.12 to resolve CVE 2018-25032 [https://www.cve.org/CVERecord?id=CVE-2018-25032].bpo-47171 [https://bugs.python.org/issue?@action=redirect&bpo=47171]: Enables installing the
py.exe
launcher on Windows ARM64.bpo-46566 [https://bugs.python.org/issue?@action=redirect&bpo=46566]: Upgraded 适用于Windows的Python启动器 to support a new
-V:company/tag
argument for full PEP 514 [https://peps.python.org/pep-0514/] support and to detect ARM64 installs. The-64
suffix on arguments is deprecated, but still selects any non-32-bit install. SettingPYLAUNCHER_ALLOW_INSTALL
and specifying a version that is not installed will attempt to install the requested version from the Microsoft Store.bpo-47086 [https://bugs.python.org/issue?@action=redirect&bpo=47086]: The installer for Windows now includes documentation as loose HTML files rather than a single compiled
.chm
file.bpo-46907 [https://bugs.python.org/issue?@action=redirect&bpo=46907]: Update Windows installer to use SQLite 3.38.1.
bpo-44549 [https://bugs.python.org/issue?@action=redirect&bpo=44549]: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE 2016-3189 [https://www.cve.org/CVERecord?id=CVE-2016-3189] and CVE 2019-12900 [https://www.cve.org/CVERecord?id=CVE-2019-12900].
bpo-46948 [https://bugs.python.org/issue?@action=redirect&bpo=46948]: Prevent CVE 2022-26488 [https://www.cve.org/CVERecord?id=CVE-2022-26488] by ensuring the Add to PATH option in the Windows installer uses the correct path when being repaired.
macOS
bpo-46890 [https://bugs.python.org/issue?@action=redirect&bpo=46890]: Fix a regression in the setting of
sys._base_executable
in framework builds, and thereby fix a regression invenv
virtual environments with such builds.bpo-46907 [https://bugs.python.org/issue?@action=redirect&bpo=46907]: Update macOS installer to SQLite 3.38.1.
工具/示例
- bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: Replace Emscripten's limited shell with Katie Bell's browser-ui REPL from python-wasm project.
C API
bpo-40421 [https://bugs.python.org/issue?@action=redirect&bpo=40421]: Add
PyFrame_GetBuiltins
,PyFrame_GetGenerator
andPyFrame_GetGlobals
C-API functions to access frame object attributes safely from C code.bpo-46850 [https://bugs.python.org/issue?@action=redirect&bpo=46850]: Move the private
_PyFrameEvalFunction
type, and privatePyInterpreterStateGetEvalFrameFunc()
andPyInterpreterStateSetEvalFrameFunc()
functions to the internal C API. The_PyFrameEvalFunction
callback function type now uses the_PyInterpreterFrame
type which is part of the internal C API. Patch by Victor Stinner.bpo-46850 [https://bugs.python.org/issue?@action=redirect&bpo=46850]: Move the private undocumented
PyEvalEvalFrameDefault()
function to the internal C API. The function now uses the_PyInterpreterFrame
type which is part of the internal C API. Patch by Victor Stinner.bpo-46850 [https://bugs.python.org/issue?@action=redirect&bpo=46850]: Remove the private undocumented function
PyEvalCallTracing()
from the C API. Call the publicsys.call_tracing()
function instead. Patch by Victor Stinner.bpo-46850 [https://bugs.python.org/issue?@action=redirect&bpo=46850]: Remove the private undocumented function
PyEvalGetCoroutineOriginTrackingDepth()
from the C API. Call the publicsys.get_coroutine_origin_tracking_depth()
function instead. Patch by Victor Stinner.bpo-46850 [https://bugs.python.org/issue?@action=redirect&bpo=46850]: Remove the following private undocumented functions from the C API:
PyEvalGetAsyncGenFirstiter()
PyEvalGetAsyncGenFinalizer()
PyEvalSetAsyncGenFirstiter()
PyEvalSetAsyncGenFinalizer()
Call the public sys.get_asyncgen_hooks()
and sys.set_asyncgen_hooks()
functions instead. Patch by Victor Stinner.
bpo-46987 [https://bugs.python.org/issue?@action=redirect&bpo=46987]: Remove private functions
PySysGetObjectId()
andPySysSetObjectId()
. Patch by Donghee Na.bpo-46906 [https://bugs.python.org/issue?@action=redirect&bpo=46906]: Add new functions to pack and unpack C double (serialize and deserialize):
PyFloat_Pack2()
,PyFloat_Pack4()
,PyFloat_Pack8()
,PyFloat_Unpack2()
,PyFloat_Unpack4()
andPyFloat_Unpack8()
. Patch by Victor Stinner.
Python 3.11.0 alpha 6
Release date: 2022-03-07
核心与内置函数
bpo-46940 [https://bugs.python.org/issue?@action=redirect&bpo=46940]: Avoid overriding
AttributeError
metadata information for nested attribute access calls. Patch by Pablo Galindo.bpo-46927 [https://bugs.python.org/issue?@action=redirect&bpo=46927]: Include the type's name in the error message for subscripting non-generic types.
bpo-46921 [https://bugs.python.org/issue?@action=redirect&bpo=46921]: Support vectorcall for
super()
. Patch by Ken Jin.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Fix incorrect handling of inline cache entries when specializing
BINARY_OP
.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use an oparg to simplify the construction of helpful error messages in
GET_AWAITABLE
.bpo-46903 [https://bugs.python.org/issue?@action=redirect&bpo=46903]: Make sure that str subclasses can be used as attribute names for instances with virtual dictionaries. Fixes regression in 3.11alpha
bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Add more detailed specialization failure stats for
COMPARE_OP
followed byEXTENDED_ARG
.bpo-46891 [https://bugs.python.org/issue?@action=redirect&bpo=46891]: Fix bug introduced during 3.11alpha where subclasses of
types.ModuleType
with__slots__
were not initialized correctly, resulting in an interpreter crash.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use inline caching for
LOAD_ATTR
,LOAD_METHOD
, andSTORE_ATTR
.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use inline cache for
BINARY_SUBSCR
.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use inline caching for
COMPARE_OP
.bpo-46864 [https://bugs.python.org/issue?@action=redirect&bpo=46864]: Deprecate
PyBytesObject.ob_shash
. It will be removed in Python 3.13.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use inline caching for
UNPACK_SEQUENCE
.bpo-46845 [https://bugs.python.org/issue?@action=redirect&bpo=46845]: 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.bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Use inline cache for
LOAD_GLOBAL
.bpo-46852 [https://bugs.python.org/issue?@action=redirect&bpo=46852]: Rename the private undocumented
float._setformat__()
method tofloat.__setformat__()
to fix a typo introduced in Python 3.7. The method is only used by test_float. Patch by Victor Stinner.bpo-46852 [https://bugs.python.org/issue?@action=redirect&bpo=46852]: Remove the undocumented private
float._setformat__()
method, previously known asfloat.__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.bpo-40116 [https://bugs.python.org/issue?@action=redirect&bpo=40116]: Fix regression that dict.update(other) may don't respect iterate order of other when other is key sharing dict.
bpo-46712 [https://bugs.python.org/issue?@action=redirect&bpo=46712]: Share global string identifiers in deep-frozen modules.
bpo-46430 [https://bugs.python.org/issue?@action=redirect&bpo=46430]: Fix memory leak in interned strings of deep-frozen modules.
bpo-46841 [https://bugs.python.org/issue?@action=redirect&bpo=46841]: Store
BINARY_OP
caches inline using a newCACHE
instruction.bpo-45107 [https://bugs.python.org/issue?@action=redirect&bpo=45107]: Specialize
LOAD_METHOD
for instances with a dict.bpo-44337 [https://bugs.python.org/issue?@action=redirect&bpo=44337]: Reduce the memory usage of specialized
LOAD_ATTR
andSTORE_ATTR
instructions.bpo-46729 [https://bugs.python.org/issue?@action=redirect&bpo=46729]: Add number of sub-exceptions to
BaseException.__str__()
.bpo-45885 [https://bugs.python.org/issue?@action=redirect&bpo=45885]: Don't un-adapt
COMPARE_OP
when collecting specialization stats.bpo-46329 [https://bugs.python.org/issue?@action=redirect&bpo=46329]: Fix specialization stats gathering for
PRECALL
instructions.bpo-46794 [https://bugs.python.org/issue?@action=redirect&bpo=46794]: Bump up the libexpat version into 2.4.6
bpo-46823 [https://bugs.python.org/issue?@action=redirect&bpo=46823]: Implement a specialized combined opcode
LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE
. Patch by Dennis Sweeney.bpo-46820 [https://bugs.python.org/issue?@action=redirect&bpo=46820]: 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.bpo-46329 [https://bugs.python.org/issue?@action=redirect&bpo=46329]: Move
KW_NAMES
beforePRECALL
instruction in call sequence. Changeoperand
ofCALL
to matchPRECALL
for easier specialization.bpo-46808 [https://bugs.python.org/issue?@action=redirect&bpo=46808]: Remove the
NEXT_BLOCK
macro from compile.c, and make the compiler automatically generate implicit blocks when they are needed.bpo-46329 [https://bugs.python.org/issue?@action=redirect&bpo=46329]: 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
andPRECALL_METHOD
are merged into a singlePRECALL
instruction.
There is no change in semantics.
bpo-46762 [https://bugs.python.org/issue?@action=redirect&bpo=46762]: Fix an assert failure in debug builds when a '<', '>', or '=' is the last character in an fstring that's missing a closing right brace.
bpo-46730 [https://bugs.python.org/issue?@action=redirect&bpo=46730]: 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.
bpo-46724 [https://bugs.python.org/issue?@action=redirect&bpo=46724]: Make sure that all backwards jumps use the
JUMP_ABSOLUTE
instruction, rather thanJUMP_FORWARD
with an argument of(2**32)+offset
.bpo-46732 [https://bugs.python.org/issue?@action=redirect&bpo=46732]: Correct the docstring for the
__bool__()
method. Patch by Jelle Zijlstra.bpo-46072 [https://bugs.python.org/issue?@action=redirect&bpo=46072]: Add more detailed specialization failure statistics for
BINARY_OP
.bpo-46707 [https://bugs.python.org/issue?@action=redirect&bpo=46707]: Avoid potential exponential backtracking when producing some syntax errors involving lots of brackets. Patch by Pablo Galindo.
bpo-46323 [https://bugs.python.org/issue?@action=redirect&bpo=46323]:
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.bpo-45923 [https://bugs.python.org/issue?@action=redirect&bpo=45923]: Add a quickened form of
RESUME
that skips quickening checks.bpo-46702 [https://bugs.python.org/issue?@action=redirect&bpo=46702]: Specialize
UNPACK_SEQUENCE
fortuple
andlist
unpackings.bpo-46072 [https://bugs.python.org/issue?@action=redirect&bpo=46072]: Opcode pair stats are now gathered with
--enable-pystats
. DefiningDYNAMIC_EXECUTION_PROFILE
orDXPAIRS
no longer has any effect.bpo-46675 [https://bugs.python.org/issue?@action=redirect&bpo=46675]: Allow more than 16 items in a split dict before it is combined. The limit is now 254.
bpo-40479 [https://bugs.python.org/issue?@action=redirect&bpo=40479]: Add a missing call to
va_end()
inModules/_hashopenssl.c
.bpo-46323 [https://bugs.python.org/issue?@action=redirect&bpo=46323]: Use
PyObject_Vectorcall()
while calling ctypes callback function. Patch by Donghee Na.bpo-46615 [https://bugs.python.org/issue?@action=redirect&bpo=46615]: 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.bpo-45828 [https://bugs.python.org/issue?@action=redirect&bpo=45828]: The bytecode compiler now attempts to apply runtime stack manipulations at compile-time (whenever it is feasible to do so).
bpo-30496 [https://bugs.python.org/issue?@action=redirect&bpo=30496]: Fixed a minor portability issue in the implementation of
PyLong_FromLong()
, and added a fast path for single-digit integers toPyLong_FromLongLong()
.
库
bpo-25707 [https://bugs.python.org/issue?@action=redirect&bpo=25707]: Fixed a file leak in
xml.etree.ElementTree.iterparse()
when the iterator is not exhausted. Patch by Jacob Walls.bpo-46877 [https://bugs.python.org/issue?@action=redirect&bpo=46877]: Export
unittest.doModuleCleanups()
inunittest
. Patch by Kumar Aditya.bpo-46848 [https://bugs.python.org/issue?@action=redirect&bpo=46848]: For performance, use the optimized string-searching implementations from
find()
andrfind()
forfind()
andrfind()
.bpo-46736 [https://bugs.python.org/issue?@action=redirect&bpo=46736]:
SimpleHTTPRequestHandler
now uses HTML5 grammar. Patch by Donghee Na.bpo-44886 [https://bugs.python.org/issue?@action=redirect&bpo=44886]: Inherit asyncio proactor datagram transport from
asyncio.DatagramTransport
.bpo-46827 [https://bugs.python.org/issue?@action=redirect&bpo=46827]: Support UDP sockets in
asyncio.loop.sock_connect()
for selector-based event loops. Patch by Thomas Grainger.bpo-46811 [https://bugs.python.org/issue?@action=redirect&bpo=46811]: Make test suite support Expat >=2.4.5
bpo-46252 [https://bugs.python.org/issue?@action=redirect&bpo=46252]: Raise
TypeError
ifssl.SSLSocket
is passed to transport-based APIs.bpo-46784 [https://bugs.python.org/issue?@action=redirect&bpo=46784]: Fix libexpat symbols collisions with user dynamically loaded or statically linked libexpat in embedded Python.
bpo-46786 [https://bugs.python.org/issue?@action=redirect&bpo=46786]: The HTML serialisation in xml.etree.ElementTree now writes
embed
,source
,track
andwbr
as empty tags, as defined in HTML 5.bpo-39327 [https://bugs.python.org/issue?@action=redirect&bpo=39327]:
shutil.rmtree()
can now work with VirtualBox shared folders when running from the guest operating-system.bpo-45390 [https://bugs.python.org/issue?@action=redirect&bpo=45390]: Propagate
asyncio.CancelledError
message from inner task to outer awaiter.bpo-46756 [https://bugs.python.org/issue?@action=redirect&bpo=46756]: Fix a bug in
urllib.request.HTTPPasswordMgr.find_user_password()
andurllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated()
which allowed to bypass authorization. For example, access to URIexample.org/foobar
was allowed if the user was authorized for URIexample.org/foo
.bpo-46737 [https://bugs.python.org/issue?@action=redirect&bpo=46737]:
random.gauss()
andrandom.normalvariate()
now have default arguments.bpo-46752 [https://bugs.python.org/issue?@action=redirect&bpo=46752]: 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().
bpo-46724 [https://bugs.python.org/issue?@action=redirect&bpo=46724]: Fix
dis
behavior on negative jump offsets.bpo-46333 [https://bugs.python.org/issue?@action=redirect&bpo=46333]: The
_repr_()
method oftyping.ForwardRef
now includes themodule
parameter oftyping.ForwardRef
when it is set.bpo-46643 [https://bugs.python.org/issue?@action=redirect&bpo=46643]: In
typing.get_type_hints()
, support evaluating stringifiedParamSpecArgs
andParamSpecKwargs
annotations. Patch by Gregory Beauregard.bpo-45863 [https://bugs.python.org/issue?@action=redirect&bpo=45863]: 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.bpo-46066 [https://bugs.python.org/issue?@action=redirect&bpo=46066]: Deprecate kwargs-based syntax for
typing.TypedDict
definitions. It had confusing semantics when specifying totality, and was largely unused. Patch by Jingchen Ye.bpo-46676 [https://bugs.python.org/issue?@action=redirect&bpo=46676]: Make
typing.ParamSpec
args and kwargs equal to themselves. Patch by Gregory Beauregard.bpo-46323 [https://bugs.python.org/issue?@action=redirect&bpo=46323]:
ctypes.CFUNCTYPE()
andctypes.WINFUNCTYPE()
now fail to create the type if itsargtypes
member contains too many arguments. Previously, the error was only raised when calling a function. Patch by Victor Stinner.bpo-46672 [https://bugs.python.org/issue?@action=redirect&bpo=46672]: Fix
NameError
inasyncio.gather()
when initial type check fails.bpo-46659 [https://bugs.python.org/issue?@action=redirect&bpo=46659]: The
calendar.LocaleTextCalendar
andcalendar.LocaleHTMLCalendar
classes now uselocale.getlocale()
, instead of usinglocale.getdefaultlocale()
, if no locale is specified. Patch by Victor Stinner.bpo-46659 [https://bugs.python.org/issue?@action=redirect&bpo=46659]: The
locale.getdefaultlocale()
function is deprecated and will be removed in Python 3.13. Uselocale.setlocale()
,locale.getpreferredencoding(False)
andlocale.getlocale()
functions instead. Patch by Victor Stinner.bpo-46655 [https://bugs.python.org/issue?@action=redirect&bpo=46655]: In
typing.get_type_hints()
, support evaluating bare stringifiedTypeAlias
annotations. Patch by Gregory Beauregard.bpo-45948 [https://bugs.python.org/issue?@action=redirect&bpo=45948]: Fixed a discrepancy in the C implementation of the
xml.etree.ElementTree
module. Now, instantiating anxml.etree.ElementTree.XMLParser
with atarget=None
keyword provides a defaultxml.etree.ElementTree.TreeBuilder
target as the Python implementation does.bpo-46626 [https://bugs.python.org/issue?@action=redirect&bpo=46626]: Expose Linux's
IP_BIND_ADDRESS_NO_PORT
option insocket
.bpo-46521 [https://bugs.python.org/issue?@action=redirect&bpo=46521]: Fix a bug in the
codeop
module that was incorrectly identifying invalid code involving string quotes as valid code.bpo-46571 [https://bugs.python.org/issue?@action=redirect&bpo=46571]: 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.
bpo-46400 [https://bugs.python.org/issue?@action=redirect&bpo=46400]: expat: Update libexpat from 2.4.1 to 2.4.4
bpo-46556 [https://bugs.python.org/issue?@action=redirect&bpo=46556]: Deprecate undocumented support for using a
pathlib.Path
object as a context manager.bpo-46534 [https://bugs.python.org/issue?@action=redirect&bpo=46534]: Implement PEP 673 [https://peps.python.org/pep-0673/]
typing.Self
. Patch by James Hilton-Balfe.bpo-46522 [https://bugs.python.org/issue?@action=redirect&bpo=46522]: Make various module
__getattr__
AttributeErrors more closely match a typical AttributeErrorbpo-46475 [https://bugs.python.org/issue?@action=redirect&bpo=46475]: Add
typing.Never
andtyping.assert_never()
. Patch by Jelle Zijlstra.bpo-46333 [https://bugs.python.org/issue?@action=redirect&bpo=46333]: The
__eq__()
and__hash__()
methods oftyping.ForwardRef
now honor themodule
parameter oftyping.ForwardRef
. Forward references from different modules are now differentiated.bpo-46246 [https://bugs.python.org/issue?@action=redirect&bpo=46246]: Add missing
__slots__
toimportlib.metadata.DeprecatedList
. Patch by Arie Bovenberg.bpo-46232 [https://bugs.python.org/issue?@action=redirect&bpo=46232]: The
ssl
module now handles certificates with bit strings in DN correctly.bpo-46195 [https://bugs.python.org/issue?@action=redirect&bpo=46195]:
typing.get_type_hints()
no longer addsOptional
to parameters withNone
as a default. This aligns to changes to PEP 484 in https://github.com/python/peps/pull/689bpo-31369 [https://bugs.python.org/issue?@action=redirect&bpo=31369]: Add
RegexFlag
tore.__all__
and documented it. AddNOFLAG
to indicate no flags being set.bpo-45898 [https://bugs.python.org/issue?@action=redirect&bpo=45898]:
ctypes
no longer definesffi_type_*
symbols incfield.c
. The symbols have been provided by libffi for over a decade.bpo-44953 [https://bugs.python.org/issue?@action=redirect&bpo=44953]: Calling
operator.itemgetter
objects andoperator.attrgetter
objects is now faster due to use of the vectorcall calling convention.bpo-44289 [https://bugs.python.org/issue?@action=redirect&bpo=44289]: Fix an issue with
is_tarfile()
method when using fileobj argument: position in the fileobj was advanced forward which made it unreadable withtarfile.TarFile.open()
.bpo-44011 [https://bugs.python.org/issue?@action=redirect&bpo=44011]: Reimplement SSL/TLS support in asyncio, borrow the implementation from uvloop library.
bpo-41086 [https://bugs.python.org/issue?@action=redirect&bpo=41086]: Make the
configparser.ConfigParser
constructor raiseTypeError
if theinterpolation
parameter is not of typeconfigparser.Interpolation
bpo-29418 [https://bugs.python.org/issue?@action=redirect&bpo=29418]: Implement
inspect.ismethodwrapper()
and fixinspect.isroutine()
for cases where methodwrapper is given. Patch by Hakan Çelik.bpo-14156 [https://bugs.python.org/issue?@action=redirect&bpo=14156]: 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
文档
- bpo-42238 [https://bugs.python.org/issue?@action=redirect&bpo=42238]:
Doc/tools/rstlint.py
has moved to its own repository and is now packaged on PyPI assphinx-lint
.
测试
bpo-46913 [https://bugs.python.org/issue?@action=redirect&bpo=46913]: 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.
bpo-46760 [https://bugs.python.org/issue?@action=redirect&bpo=46760]: Remove bytecode offsets from expected values in test.test_dis module. Reduces the obstacles to modifying the VM or compiler.
bpo-46708 [https://bugs.python.org/issue?@action=redirect&bpo=46708]: Prevent default asyncio event loop policy modification warning after
test_asyncio
execution.bpo-46678 [https://bugs.python.org/issue?@action=redirect&bpo=46678]: The function
make_legacy_pyc
inLib/test/support/import_helper.py
no longer fails whenPYTHONPYCACHEPREFIX
is set to a directory on a different device from where tempfiles are stored.bpo-46623 [https://bugs.python.org/issue?@action=redirect&bpo=46623]: 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.
构建
bpo-46860 [https://bugs.python.org/issue?@action=redirect&bpo=46860]: Respect
--with-suffix
when building on case-insensitive file systems.bpo-46656 [https://bugs.python.org/issue?@action=redirect&bpo=46656]: Building Python now requires a C11 compiler. Optional C11 features are not required. Patch by Victor Stinner.
bpo-46656 [https://bugs.python.org/issue?@action=redirect&bpo=46656]: Building Python now requires support for floating-point Not-a-Number (NaN): remove the
Py_NO_NAN
macro. Patch by Victor Stinner.bpo-46640 [https://bugs.python.org/issue?@action=redirect&bpo=46640]: Building Python now requires a C99
header file providing aNAN
constant, or the__builtin_nan()
builtin function. Patch by Victor Stinner.bpo-46608 [https://bugs.python.org/issue?@action=redirect&bpo=46608]: Exclude marshalled-frozen data if deepfreezing to save 300 KB disk space. This includes adding a new
is_package
field to_frozen
. Patch by Kumar Aditya.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: 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 count 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.
bpo-46430 [https://bugs.python.org/issue?@action=redirect&bpo=46430]: Intern strings in deep-frozen modules. Patch by Kumar Aditya.
Windows
bpo-46744 [https://bugs.python.org/issue?@action=redirect&bpo=46744]: The default all users install directory for ARM64 is now under the native
Program Files
folder, rather thanProgram Files (Arm)
which is intended for ARM (32-bit) files.bpo-46567 [https://bugs.python.org/issue?@action=redirect&bpo=46567]: Adds Tcl and Tk support for Windows ARM64. This also adds IDLE to the installation.
bpo-46638 [https://bugs.python.org/issue?@action=redirect&bpo=46638]: 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).
IDLE
bpo-46630 [https://bugs.python.org/issue?@action=redirect&bpo=46630]: Make query dialogs on Windows start with a cursor in the entry box.
bpo-45447 [https://bugs.python.org/issue?@action=redirect&bpo=45447]: Apply IDLE syntax highlighting to
.pyi
files. Patch by Alex Waygood and Terry Jan Reedy.
C API
bpo-46748 [https://bugs.python.org/issue?@action=redirect&bpo=46748]: Python's public headers no longer import
, leaving code that embeds/extends Python free to definebool
,true
andfalse
.bpo-46836 [https://bugs.python.org/issue?@action=redirect&bpo=46836]: Move the
PyFrameObject
type definition (struct _frame
) to the internal C APIpycore_frame.h
header file. Patch by Victor Stinner.bpo-45459 [https://bugs.python.org/issue?@action=redirect&bpo=45459]: Rename
Include/buffer.h
header file toInclude/pybuffer.h
to avoid conflicts with projects having an existingbuffer.h
header file. Patch by Victor Stinner.bpo-45412 [https://bugs.python.org/issue?@action=redirect&bpo=45412]: Remove the
HAVE_PY_SET_53BIT_PRECISION
macro (moved to the internal C API). Patch by Victor Stinner.bpo-46613 [https://bugs.python.org/issue?@action=redirect&bpo=46613]: Added function
PyType_GetModuleByDef()
, which allows access to module state when a method's defining class is not available.
Python 3.11.0 alpha 5
Release date: 2022-02-03
核心与内置函数
bpo-45773 [https://bugs.python.org/issue?@action=redirect&bpo=45773]: Remove two invalid "peephole" optimizations from the bytecode compiler.
bpo-46564 [https://bugs.python.org/issue?@action=redirect&bpo=46564]: Do not create frame objects when creating
super
object. Patch by Kumar Aditya.bpo-45885 [https://bugs.python.org/issue?@action=redirect&bpo=45885]: Added more fined-grained specialization failure stats regarding the
COMPARE_OP
bytecode.bpo-44977 [https://bugs.python.org/issue?@action=redirect&bpo=44977]: The delegation of
int()
to__trunc__()
is now deprecated. Callingint(a)
whentype(a)
implements__trunc__()
but not__int__()
or__index__()
now raises aDeprecationWarning
.bpo-46458 [https://bugs.python.org/issue?@action=redirect&bpo=46458]: Reorder code emitted by the compiler for a
try
-except
block so that theelse
block's code immediately follows thetry
body (without a jump). This is more optimal for the happy path.bpo-46527 [https://bugs.python.org/issue?@action=redirect&bpo=46527]: Allow passing
iterable
as a keyword argument toenumerate()
again. Patch by Jelle Zijlstra.bpo-46528 [https://bugs.python.org/issue?@action=redirect&bpo=46528]: Replace several stack manipulation instructions (
DUP_TOP
,DUP_TOP_TWO
,ROT_TWO
,ROT_THREE
,ROT_FOUR
, andROT_N
) with newCOPY
andSWAP
instructions.bpo-46329 [https://bugs.python.org/issue?@action=redirect&bpo=46329]: Use two or three bytecodes to implement most calls.
Calls without named arguments are implemented as a sequence of two instructions: PRECALL; CALL
. Calls with named arguments are implemented as a sequence of three instructions: PRECALL; KW_NAMES;
CALL
. There are two different PRECALL
instructions: PRECALL_FUNTION
and PRECALL_METHOD
. The latter pairs with LOAD_METHOD
.
This partition into pre-call and call allows better specialization, and thus better performance ultimately.
There is no change in semantics.
bpo-46503 [https://bugs.python.org/issue?@action=redirect&bpo=46503]: Fix an assert when parsing some invalid N escape sequences in fstrings.
bpo-46431 [https://bugs.python.org/issue?@action=redirect&bpo=46431]: Improve error message on invalid calls to
BaseExceptionGroup._new_()
.bpo-46476 [https://bugs.python.org/issue?@action=redirect&bpo=46476]: Fix memory leak in code objects generated by deepfreeze. Patch by Kumar Aditya.
bpo-46481 [https://bugs.python.org/issue?@action=redirect&bpo=46481]: Speed up calls to
weakref.ref.__call__()
by using the PEP 590 [https://peps.python.org/pep-0590/]vectorcall
calling convention. Patch by Donghee Na.bpo-46417 [https://bugs.python.org/issue?@action=redirect&bpo=46417]: Fix a race condition on setting a type
__bases__
attribute: the internal functionadd_subclass()
now gets thePyTypeObject.tp_subclasses
member after callingPyWeakref_NewRef()
which can trigger a garbage collection which can indirectly modifyPyTypeObject.tp_subclasses
. Patch by Victor Stinner.bpo-46417 [https://bugs.python.org/issue?@action=redirect&bpo=46417]:
python -X showrefcount
now shows the total reference count after clearing and destroyed the main Python interpreter. Previously, it was shown before. Patch by Victor Stinner.bpo-43683 [https://bugs.python.org/issue?@action=redirect&bpo=43683]: Add ASYNC_GEN_WRAP opcode to wrap the value to be yielded in async generators. Removes the need to special case async generators in the
YIELD_VALUE
instruction.bpo-46407 [https://bugs.python.org/issue?@action=redirect&bpo=46407]: Optimize some modulo operations in
Objects/longobject.c
. Patch by Jeremiah Vivian.bpo-46409 [https://bugs.python.org/issue?@action=redirect&bpo=46409]: Add new
RETURN_GENERATOR
bytecode to make generators. Simplifies calling Python functions in the VM, as they no longer any need to special case generator functions.
Also add JUMP_NO_INTERRUPT
bytecode that acts like JUMP_ABSOLUTE
, but does not check for interrupts.
bpo-46406 [https://bugs.python.org/issue?@action=redirect&bpo=46406]: The integer division
//
implementation has been optimized to better let the compiler understand its constraints. It can be 20% faster on the amd64 platform when dividing an int by a value smaller than2**30
.bpo-46383 [https://bugs.python.org/issue?@action=redirect&bpo=46383]: Fix invalid signature of
_zoneinfo
'smodule_free
function to resolve a crash on wasm32-emscripten platform.bpo-46361 [https://bugs.python.org/issue?@action=redirect&bpo=46361]: Ensure that "small" integers created by
int.from_bytes()
anddecimal.Decimal
are properly cached.bpo-46161 [https://bugs.python.org/issue?@action=redirect&bpo=46161]: Fix the class building error when the arguments are constants and CALL_FUNCTION_EX is used.
bpo-46028 [https://bugs.python.org/issue?@action=redirect&bpo=46028]: Fixes calculation of
sys._base_executable
when inside a virtual environment that uses symlinks with different binary names than the base environment provides.bpo-46091 [https://bugs.python.org/issue?@action=redirect&bpo=46091]: Correctly calculate indentation levels for lines with whitespace character that are ended by line continuation characters. Patch by Pablo Galindo
bpo-30512 [https://bugs.python.org/issue?@action=redirect&bpo=30512]: Add CAN Socket support for NetBSD.
bpo-46045 [https://bugs.python.org/issue?@action=redirect&bpo=46045]: Do not use POSIX semaphores on NetBSD
bpo-44024 [https://bugs.python.org/issue?@action=redirect&bpo=44024]: Improve the
TypeError
message for non-string second arguments passed to the builtin functionsgetattr()
andhasattr()
. Patch by Géry Ogam.
库
bpo-46624 [https://bugs.python.org/issue?@action=redirect&bpo=46624]: Restore support for non-integer arguments of
random.randrange()
andrandom.randint()
.bpo-46591 [https://bugs.python.org/issue?@action=redirect&bpo=46591]: Make the IDLE doc URL on the About IDLE dialog clickable.
bpo-46565 [https://bugs.python.org/issue?@action=redirect&bpo=46565]: Remove loop variables that are leaking into modules' namespaces.
bpo-46553 [https://bugs.python.org/issue?@action=redirect&bpo=46553]: In
typing.get_type_hints()
, support evaluating bare stringifiedClassVar
annotations. Patch by Gregory Beauregard.bpo-46544 [https://bugs.python.org/issue?@action=redirect&bpo=46544]: Don't leak
x
&uspace
intermediate vars intextwrap.TextWrapper
.bpo-46487 [https://bugs.python.org/issue?@action=redirect&bpo=46487]: Add the
getwritebuffer_limits
method toasyncio.transports.WriteTransport
and to the SSL transport.bpo-45173 [https://bugs.python.org/issue?@action=redirect&bpo=45173]: Note the configparser deprecations will be removed in Python 3.12.
bpo-45162 [https://bugs.python.org/issue?@action=redirect&bpo=45162]: The deprecated
unittest
APIs removed in 3.11a1 have been temporarily restored to be removed in 3.12 while cleanups in external projects go in.bpo-46539 [https://bugs.python.org/issue?@action=redirect&bpo=46539]: In
typing.get_type_hints()
, support evaluating stringifiedClassVar
andFinal
annotations insideAnnotated
. Patch by Gregory Beauregard.bpo-46510 [https://bugs.python.org/issue?@action=redirect&bpo=46510]: Add missing test for
types.TracebackType
andtypes.FrameType
. Calculate them directly from the caught exception without callingsys.exc_info()
.bpo-46491 [https://bugs.python.org/issue?@action=redirect&bpo=46491]: Allow
typing.Annotated
to wraptyping.Final
andtyping.ClassVar
. Patch by Gregory Beauregard.bpo-46483 [https://bugs.python.org/issue?@action=redirect&bpo=46483]: Remove
__class_getitem__()
frompathlib.PurePath
as this class was not supposed to be generic.bpo-46436 [https://bugs.python.org/issue?@action=redirect&bpo=46436]: Fix commandline option
-d
/--directory
in modulehttp.server
which is ignored when combined with commandline option--cgi
. Patch by Géry Ogam.bpo-41403 [https://bugs.python.org/issue?@action=redirect&bpo=41403]: Make
mock.patch()
raise aTypeError
with a relevant error message on invalid arg. Previously it allowed a crypticAttributeError
to escape.bpo-46474 [https://bugs.python.org/issue?@action=redirect&bpo=46474]: In
importlib.metadata.EntryPoint.pattern
, avoid potential REDoS by limiting ambiguity in consecutive whitespace.bpo-46474 [https://bugs.python.org/issue?@action=redirect&bpo=46474]: Removed private method from
importlib.metadata.Path
. Sync with importlib_metadata 4.10.0.bpo-46470 [https://bugs.python.org/issue?@action=redirect&bpo=46470]: Remove unused branch from
typing._remove_dups_flatten
bpo-46469 [https://bugs.python.org/issue?@action=redirect&bpo=46469]:
asyncio
generic classes now returntypes.GenericAlias
in__class_getitem__
instead of the same class.bpo-41906 [https://bugs.python.org/issue?@action=redirect&bpo=41906]: Support passing filter instances in the
filters
values ofhandlers
andloggers
in the dictionary passed tologging.config.dictConfig()
.bpo-46422 [https://bugs.python.org/issue?@action=redirect&bpo=46422]: Use
dis.Positions
indis.Instruction
instead of a regulartuple
.bpo-46434 [https://bugs.python.org/issue?@action=redirect&bpo=46434]:
pdb
now gracefully handleshelp
when__doc__
is missing, for example when run with pregenerated optimized.pyc
files.bpo-43869 [https://bugs.python.org/issue?@action=redirect&bpo=43869]: Python uses the same time Epoch on all platforms. Add an explicit unit test to ensure that it's the case. Patch by Victor Stinner.
bpo-46414 [https://bugs.python.org/issue?@action=redirect&bpo=46414]: Add
typing.reveal_type()
. Patch by Jelle Zijlstra.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]:
subprocess
now imports Windows-specific imports whenmsvcrt
module is available, and POSIX-specific imports on all other platforms. This gives a clean exception when_posixsubprocess
is not available (e.g. Emscripten browser target).bpo-40066 [https://bugs.python.org/issue?@action=redirect&bpo=40066]:
IntEnum
,IntFlag
, andStrEnum
use the mixed-in type for theirstr()
andformat()
output.bpo-46316 [https://bugs.python.org/issue?@action=redirect&bpo=46316]: Optimize
pathlib.Path.iterdir()
by removing an unnecessary check for special entries.bpo-29688 [https://bugs.python.org/issue?@action=redirect&bpo=29688]: Document
pathlib.Path.absolute()
(which has always existed).bpo-43012 [https://bugs.python.org/issue?@action=redirect&bpo=43012]: The pathlib module's obsolete and internal
_Accessor
class has been removed to prepare the terrain for upcoming enhancements to the module.bpo-46258 [https://bugs.python.org/issue?@action=redirect&bpo=46258]: Speed up
math.isqrt()
for small positive integers by replacing two division steps with a lookup table.bpo-46242 [https://bugs.python.org/issue?@action=redirect&bpo=46242]: Improve error message when creating a new
enum.Enum
type subclassing an existingEnum
withmembernames_
usingenum.Enum.__call__()
.bpo-43118 [https://bugs.python.org/issue?@action=redirect&bpo=43118]: Fix a bug in
inspect.signature()
that was causing it to fail on some subclasses of classes with a__textsignature_
referencing module globals. Patch by Weipeng Hong.bpo-26552 [https://bugs.python.org/issue?@action=redirect&bpo=26552]: Fixed case where failing
asyncio.ensure_future()
did not close the coroutine. Patch by Kumar Aditya.bpo-21987 [https://bugs.python.org/issue?@action=redirect&bpo=21987]: Fix an issue with
tarfile.TarFile.getmember()
getting a directory name with a trailing slash.bpo-46124 [https://bugs.python.org/issue?@action=redirect&bpo=46124]: Update
zoneinfo
to rely on importlib.resources traversable API.bpo-46103 [https://bugs.python.org/issue?@action=redirect&bpo=46103]: Now
inspect.getmembers()
only gets__bases__
attribute from class type. Patch by Weipeng Hong.bpo-46080 [https://bugs.python.org/issue?@action=redirect&bpo=46080]: Fix exception in argparse help text generation if a
argparse.BooleanOptionalAction
argument's default isargparse.SUPPRESS
and it hashelp
specified. Patch by Felix Fontein.bpo-44791 [https://bugs.python.org/issue?@action=redirect&bpo=44791]: Fix substitution of
ParamSpec
inConcatenate
with different parameter expressions. Substitution with a list of types returns now a tuple of types. Substitution withConcatenate
returns now aConcatenate
with concatenated lists of arguments.
文档
- bpo-46463 [https://bugs.python.org/issue?@action=redirect&bpo=46463]: Fixes
escape4chm.py
script used when building the CHM documentation file
测试
bpo-43478 [https://bugs.python.org/issue?@action=redirect&bpo=43478]: Mocks can no longer be provided as the specs for other Mocks. As a result, an already-mocked object cannot be passed to
mock.Mock()
. This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass.bpo-46616 [https://bugs.python.org/issue?@action=redirect&bpo=46616]: Ensures
test_importlib.test_windows
cleans up registry keys after completion.bpo-44359 [https://bugs.python.org/issue?@action=redirect&bpo=44359]: test_ftplib now silently ignores socket errors to prevent logging unhandled threading exceptions. Patch by Victor Stinner.
bpo-46600 [https://bugs.python.org/issue?@action=redirect&bpo=46600]: Fix test_gdb.test_pycfunction() for Python built with
clang -Og
. Tolerate inlined functions in the gdb traceback. Patch by Victor Stinner.bpo-46542 [https://bugs.python.org/issue?@action=redirect&bpo=46542]: Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. Patch by Victor Stinner.
bpo-46576 [https://bugs.python.org/issue?@action=redirect&bpo=46576]: test_peg_generator now disables compiler optimization when testing compilation of its own C extensions to significantly speed up the testing on non-debug builds of CPython.
bpo-46542 [https://bugs.python.org/issue?@action=redirect&bpo=46542]: Fix
test_json
tests checking forRecursionError
: modify these tests to usesupport.infinite_recursion()
. Patch by Victor Stinner.bpo-13886 [https://bugs.python.org/issue?@action=redirect&bpo=13886]: Skip test_builtin PTY tests on nonASCII characters if the readline module is loaded. The readline module changes input() behavior, but test_builtin is not intended to test the readline module. Patch by Victor Stinner.
bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: Add
test.support.requires_fork()
decorators to mark tests that require a workingos.fork()
.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: Add
test.support.requires_subprocess()
decorator to mark tests which require workingsubprocess
module oros.spawn*
. The wasm32-emscripten platform has no support for processes.bpo-46126 [https://bugs.python.org/issue?@action=redirect&bpo=46126]: Disable 'descriptions' when running tests internally.
构建
bpo-46602 [https://bugs.python.org/issue?@action=redirect&bpo=46602]: Tidied up configure.ac so that conftest.c is truncated rather than appended. This assists in the case where the 'rm' of conftest.c fails to happen between tests. Downstream issues such as a clobbered SOABI can result.
bpo-46600 [https://bugs.python.org/issue?@action=redirect&bpo=46600]: Fix the test checking if the C compiler supports
-Og
option in the./configure
script to also use-Og
on clang which supports it. Patch by Victor Stinner.bpo-38472 [https://bugs.python.org/issue?@action=redirect&bpo=38472]: Fix GCC detection in setup.py when cross-compiling. The C compiler is now run with LC_ALL=C. Previously, the detection failed with a German locale.
bpo-46513 [https://bugs.python.org/issue?@action=redirect&bpo=46513]: configure no longer uses
AC_C_CHAR_UNSIGNED
macro andpyconfig.h
no longer defines reserved symbol__CHAR_UNSIGNED__
.bpo-46471 [https://bugs.python.org/issue?@action=redirect&bpo=46471]: Use global singletons for single byte bytes objects in deepfreeze.
bpo-46443 [https://bugs.python.org/issue?@action=redirect&bpo=46443]: Deepfreeze now uses cached small integers as it saves some space for common small integers.
bpo-46429 [https://bugs.python.org/issue?@action=redirect&bpo=46429]: Merge all deep-frozen files into one for space savings. Patch by Kumar Aditya.
bpo-45569 [https://bugs.python.org/issue?@action=redirect&bpo=45569]: The build now defaults to using 30-bit digits for Python integers. Previously either 15-bit or 30-bit digits would be selected, depending on the platform. 15-bit digits may still be selected using the
--enable-big-digits=15
option to theconfigure
script, or by definingPYLONG_BITS_IN_DIGIT
inpyconfig.h
.bpo-45925 [https://bugs.python.org/issue?@action=redirect&bpo=45925]: Update Windows installer to use SQLite 3.37.2.
bpo-43112 [https://bugs.python.org/issue?@action=redirect&bpo=43112]: Detect musl libc as a separate SOABI (tagged as
linux-musl
).
Windows
bpo-33125 [https://bugs.python.org/issue?@action=redirect&bpo=33125]: The traditional EXE/MSI based installer for Windows is now available for ARM64
bpo-46362 [https://bugs.python.org/issue?@action=redirect&bpo=46362]: os.path.abspath("C:CON") is now fixed to return ".CON", not the same path. The regression was true of all legacy DOS devices such as COM1, LPT1, or NUL.
bpo-44934 [https://bugs.python.org/issue?@action=redirect&bpo=44934]: The installer now offers a commandline only option to add the installation directory to the end of
PATH
instead of at the start.
macOS
- bpo-45925 [https://bugs.python.org/issue?@action=redirect&bpo=45925]: Update macOS installer to SQLite 3.37.2.
IDLE
- bpo-45296 [https://bugs.python.org/issue?@action=redirect&bpo=45296]: Clarify close, quit, and exit in IDLE. In the File menu, 'Close' and 'Exit' are now 'Close Window' (the current one) and 'Exit' is now 'Exit IDLE' (by closing all windows). In Shell, 'quit()' and 'exit()' mean 'close Shell'. If there are no other windows, this also exits IDLE.
C API
bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]: Remove the
PyHeapType_GET_MEMBERS()
macro. It was exposed in the public C API by mistake, it must only be used by Python internally. Use thePyTypeObject.tp_members
member instead. Patch by Victor Stinner.bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]: Move PyGetAllocatedBlocks() and PyObjectDebugMallocStats() private functions to the internal C API. Patch by Victor Stinner.
bpo-46433 [https://bugs.python.org/issue?@action=redirect&bpo=46433]: The internal function PyTypeGetModuleByDef now correctly handles inheritance patterns involving static types.
bpo-45459 [https://bugs.python.org/issue?@action=redirect&bpo=45459]:
Py_buffer
and variousPy_buffer
related functions are now part of the limited API and stable ABI.bpo-14916 [https://bugs.python.org/issue?@action=redirect&bpo=14916]: Fixed bug in the tokenizer that prevented
PyRun_InteractiveOne
from parsing from the provided FD.
Python 3.11.0 alpha 4
Release date: 2022-01-13
核心与内置函数
bpo-46070 [https://bugs.python.org/issue?@action=redirect&bpo=46070]:
Py_EndInterpreter()
now explicitly untracks all objects currently tracked by the GC. Previously, if an object was used later by another interpreter, callingPyObject_GC_UnTrack()
on the object crashed if the previous or the next object of thePyGC_Head
structure became a dangling pointer. Patch by Victor Stinner.bpo-46347 [https://bugs.python.org/issue?@action=redirect&bpo=46347]: Fix memory leak in PyEval_EvalCodeEx.
bpo-46339 [https://bugs.python.org/issue?@action=redirect&bpo=46339]: Fix a crash in the parser when retrieving the error text for multiline fstrings expressions that do not start in the first line of the string. Patch by Pablo Galindo
bpo-46331 [https://bugs.python.org/issue?@action=redirect&bpo=46331]: Do not set line number of instruction storing docstring. Fixes regression introduced in 3.11 alpha.
bpo-46314 [https://bugs.python.org/issue?@action=redirect&bpo=46314]: Remove spurious "call" event when creating a lambda function that was accidentally introduced in 3.11a4.
bpo-46289 [https://bugs.python.org/issue?@action=redirect&bpo=46289]: ASDL declaration of
FormattedValue
has changed to reflectconversion
field is not optional.bpo-46297 [https://bugs.python.org/issue?@action=redirect&bpo=46297]: Fixed an interpreter crash on bootup with multiple PythonPaths set in the Windows registry. Patch by Derzsi Dániel.
bpo-46237 [https://bugs.python.org/issue?@action=redirect&bpo=46237]: Fix the line number of tokenizer errors inside fstrings. Patch by Pablo Galindo.
bpo-46263 [https://bugs.python.org/issue?@action=redirect&bpo=46263]: We always expect the "usefrozenmodules" config to be set, now that getpath.c was rewritten in pure Python and the logic improved.
bpo-46006 [https://bugs.python.org/issue?@action=redirect&bpo=46006]: Fix a regression when a type method like
__init__()
is modified in a subinterpreter. Fix a regression inPyUnicodeEqualToASCIIId()
and typeupdate_slot()
. Revert the change which made the Unicode dictionary of interned strings compatible with subinterpreters: the internal interned dictionary is shared again by all interpreters. Patch by Victor Stinner.bpo-45923 [https://bugs.python.org/issue?@action=redirect&bpo=45923]: Add RESUME opcode. This is a logical no-op. It is emitted by the compiler anywhere a Python function can be entered. It is used by the interpreter to perform tracing and optimizer checks.
bpo-46208 [https://bugs.python.org/issue?@action=redirect&bpo=46208]: Fix the regression of os.path.normpath("A/../../B") not returning expected "../B" but "B".
bpo-46240 [https://bugs.python.org/issue?@action=redirect&bpo=46240]: Correct the error message for unclosed parentheses when the tokenizer doesn't reach the end of the source when the error is reported. Patch by Pablo Galindo
bpo-46009 [https://bugs.python.org/issue?@action=redirect&bpo=46009]: Remove the
GEN_START
opcode.bpo-46235 [https://bugs.python.org/issue?@action=redirect&bpo=46235]: Certain sequence multiplication operations like
[0] * 1_000
are now faster due to reference-counting optimizations. Patch by Dennis Sweeney.bpo-46221 [https://bugs.python.org/issue?@action=redirect&bpo=46221]:
PREP_RERAISE_STAR
no longer pusheslasti
to the stack.bpo-46202 [https://bugs.python.org/issue?@action=redirect&bpo=46202]: Remove
POP_EXCEPT_AND_RERAISE
and replace it by an equivalent sequence of other opcodes.bpo-46085 [https://bugs.python.org/issue?@action=redirect&bpo=46085]: Fix iterator cache mechanism of
OrderedDict
.bpo-46055 [https://bugs.python.org/issue?@action=redirect&bpo=46055]: Speed up shifting operation involving integers less than
PyLong_BASE
. Patch by Xinhang Xu.bpo-46110 [https://bugs.python.org/issue?@action=redirect&bpo=46110]: Add a maximum recursion check to the PEG parser to avoid stack overflow. Patch by Pablo Galindo
bpo-46107 [https://bugs.python.org/issue?@action=redirect&bpo=46107]: Fix bug where
ExceptionGroup.split()
andExceptionGroup.subgroup()
did not copy the exception group's__note__
field to the parts.bpo-45711 [https://bugs.python.org/issue?@action=redirect&bpo=45711]: The interpreter state's representation of handled exceptions (a.k.a exc_info, or PyErrStackItem) now has only the
exc_value
field,exc_type
andexc_traceback
have been removed as their values can be derived fromexc_value
.bpo-44525 [https://bugs.python.org/issue?@action=redirect&bpo=44525]: Replace the four call bytecode instructions which one pre-call instruction and two call instructions.
Removes CALL_FUNCTION
, CALL_FUNCTION_KW
, CALL_METHOD
and CALL_METHOD_KW
.
Adds CALL_NO_KW
and CALL_KW
call instructions, and PRECALL_METHOD
prefix for pairing with LOAD_METHOD
.
bpo-46039 [https://bugs.python.org/issue?@action=redirect&bpo=46039]: Remove the
YIELD_FROM
instruction and replace it with theSEND
instruction which performs the same operation, but without the loop.bpo-45635 [https://bugs.python.org/issue?@action=redirect&bpo=45635]: The code called from
PyErrDisplay()
was refactored to improve error handling. It now exits immediately upon an unrecoverable error.bpo-46054 [https://bugs.python.org/issue?@action=redirect&bpo=46054]: Fix parser error when parsing non-utf8 characters in source files. Patch by Pablo Galindo.
bpo-46042 [https://bugs.python.org/issue?@action=redirect&bpo=46042]: Improve the location of the caret in
SyntaxError
exceptions emitted by the symbol table. Patch by Pablo Galindo.bpo-46049 [https://bugs.python.org/issue?@action=redirect&bpo=46049]: Ensure
._pth
files work as intended on platforms other than Windows.bpo-46048 [https://bugs.python.org/issue?@action=redirect&bpo=46048]: Fixes parsing of
._pth
files on startup so that single-character paths are correctly read.bpo-37971 [https://bugs.python.org/issue?@action=redirect&bpo=37971]: Fix a bug where the line numbers given in a traceback when a decorator application raised an exception were wrong.
bpo-46031 [https://bugs.python.org/issue?@action=redirect&bpo=46031]: Add
POP_JUMP_IF_NOT_NONE
andPOP_JUMP_IF_NONE
opcodes to speed up conditional jumps.bpo-45654 [https://bugs.python.org/issue?@action=redirect&bpo=45654]: Deepfreeze
runpy
, patch by Kumar Aditya.bpo-46025 [https://bugs.python.org/issue?@action=redirect&bpo=46025]: Fix a crash in the
atexit
module involving functions that unregister themselves before raising exceptions. Patch by Pablo Galindo.bpo-46000 [https://bugs.python.org/issue?@action=redirect&bpo=46000]: Improve compatibility of the
curses
module with NetBSD curses.bpo-44525 [https://bugs.python.org/issue?@action=redirect&bpo=44525]: Specialize the CALL_FUNCTION instruction for calls to builtin types with a single argument. Speeds up
range(x)
,list(x)
, and specificallytype(obj)
.bpo-42918 [https://bugs.python.org/issue?@action=redirect&bpo=42918]: Fix bug where the builtin
compile()
function did not always raise aSyntaxError
when passed multiple statements in 'single' mode. Patch by Weipeng Hong.bpo-45953 [https://bugs.python.org/issue?@action=redirect&bpo=45953]: The main interpreter in PyRuntimeState.interpreters is now statically allocated (as part of PyRuntime). Likewise for the initial thread state of each interpreter. This means less allocation during runtime init, as well as better memory locality for these key state objects.
bpo-45292 [https://bugs.python.org/issue?@action=redirect&bpo=45292]: Complete the PEP 654 [https://peps.python.org/pep-0654/] implementation: add
except*
.bpo-43413 [https://bugs.python.org/issue?@action=redirect&bpo=43413]: Revert changes in
set.__init__
. Subclass ofset
needs to define a__init__()
method if it defines a_new_()
method with additional keyword parameters.bpo-43931 [https://bugs.python.org/issue?@action=redirect&bpo=43931]: Added the
Py_Version
constant which bears the same value asPY_VERSION_HEX
. Patch by Gabriele N. Tornetta.
库
bpo-46342 [https://bugs.python.org/issue?@action=redirect&bpo=46342]: The
@typing.final
decorator now sets the__final__
attribute on the decorated object to allow runtime introspection. Patch by Jelle Zijlstra.bpo-46328 [https://bugs.python.org/issue?@action=redirect&bpo=46328]: Added the
sys.exception()
method which returns the active exception instance.bpo-46307 [https://bugs.python.org/issue?@action=redirect&bpo=46307]: Add
string.Template.is_valid()
andstring.Template.get_identifiers()
methods.bpo-46306 [https://bugs.python.org/issue?@action=redirect&bpo=46306]: Assume that
types.CodeType
always hastypes.CodeType.co_firstlineno
indoctest
.bpo-40479 [https://bugs.python.org/issue?@action=redirect&bpo=40479]: Fix
hashlib
usedforsecurity option to work correctly with OpenSSL 3.0.0 in FIPS mode.bpo-46070 [https://bugs.python.org/issue?@action=redirect&bpo=46070]: Fix possible segfault when importing the
asyncio
module from different subinterpreters in parallel. Patch by Erlend E. Aasland.bpo-46244 [https://bugs.python.org/issue?@action=redirect&bpo=46244]: Removed
__slots__
fromtyping.ParamSpec
andtyping.TypeVar
. They served no purpose. Patch by Arie Bovenberg.bpo-46278 [https://bugs.python.org/issue?@action=redirect&bpo=46278]: Reflect
context
argument inAbstractEventLoop.call_*()
methods. Loop implementations already support it.bpo-46269 [https://bugs.python.org/issue?@action=redirect&bpo=46269]: Remove special-casing of
_new_
inenum.Enum.__dir__()
.bpo-46266 [https://bugs.python.org/issue?@action=redirect&bpo=46266]: Improve day constants in
calendar
.
Now all constants (MONDAY
… SUNDAY
) are documented, tested, and added to __all__
.
bpo-46257 [https://bugs.python.org/issue?@action=redirect&bpo=46257]: Optimized the mean, variance, and stdev functions in the statistics module. If the input is an iterator, it is consumed in a single pass rather than eating memory by conversion to a list. The single pass algorithm is about twice as fast as the previous two pass code.
bpo-41011 [https://bugs.python.org/issue?@action=redirect&bpo=41011]: Added two new variables to pyvenv.cfg which is generated by
venv
module: executable for the executable and command for the command line used to create the environment.bpo-46239 [https://bugs.python.org/issue?@action=redirect&bpo=46239]: Improve error message when importing
asyncio.windows_events
on non-Windows.bpo-46238 [https://bugs.python.org/issue?@action=redirect&bpo=46238]: Reuse
_winapi
constants inasyncio.windows_events
.bpo-46222 [https://bugs.python.org/issue?@action=redirect&bpo=46222]: Adding
SF_NOCACHE
sendfile constant for FreeBSD for the posixmodule.bpo-37295 [https://bugs.python.org/issue?@action=redirect&bpo=37295]: Add fast path for
0 <= k <= n <= 67
formath.comb()
.bpo-46176 [https://bugs.python.org/issue?@action=redirect&bpo=46176]: Adding the
MAP_STACK
constant for the mmap module.bpo-43424 [https://bugs.python.org/issue?@action=redirect&bpo=43424]: Deprecate
webbrowser.MacOSXOSAScript._name
and usename
instead.bpo-45321 [https://bugs.python.org/issue?@action=redirect&bpo=45321]: Added missing error codes to module
xml.parsers.expat.errors
.bpo-46125 [https://bugs.python.org/issue?@action=redirect&bpo=46125]: Refactor tests to test traversable API directly. Includes changes from importlib 5.4.0.
bpo-46118 [https://bugs.python.org/issue?@action=redirect&bpo=46118]: Moved importlib.resources and its related functionality to a package.
bpo-37578 [https://bugs.python.org/issue?@action=redirect&bpo=37578]: Add include_hidden parameter to
glob()
andiglob()
to match hidden files and directories when using special characters like*
,**
,?
and[]
.bpo-20369 [https://bugs.python.org/issue?@action=redirect&bpo=20369]:
concurrent.futures.wait()
no longer blocks forever when given duplicate Futures. Patch by Kumar Aditya.bpo-46105 [https://bugs.python.org/issue?@action=redirect&bpo=46105]: Honor spec when generating requirement specs with urls and extras (importlib_metadata 4.8.3).
bpo-44893 [https://bugs.python.org/issue?@action=redirect&bpo=44893]: EntryPoint objects are no longer tuples. Recommended means to access is by attribute ('.name', '.group') or accessor ('.load()'). Access by index is deprecated and will raise deprecation warning.
bpo-22815 [https://bugs.python.org/issue?@action=redirect&bpo=22815]: Print unexpected successes together with failures and errors in summary in
unittest.TextTestResult
.bpo-22047 [https://bugs.python.org/issue?@action=redirect&bpo=22047]: Calling
add_argument_group()
on an argument group is deprecated. Callingadd_argument_group()
oradd_mutually_exclusive_group()
on a mutually exclusive group is deprecated.
These features were never supported and do not always work correctly. The functions exist on the API by accident through inheritance and will be removed in the future.
bpo-26952 [https://bugs.python.org/issue?@action=redirect&bpo=26952]:
argparse
raisesValueError
with clear message when trying to render usage for an empty mutually exclusive group. Previously it raised a crypticIndexError
.bpo-45615 [https://bugs.python.org/issue?@action=redirect&bpo=45615]: Functions in the
traceback
module raiseTypeError
rather thanAttributeError
when an exception argument is not of typeBaseException
.bpo-16594 [https://bugs.python.org/issue?@action=redirect&bpo=16594]: Add allow allow_reuse_port flag in socketserver.
bpo-27718 [https://bugs.python.org/issue?@action=redirect&bpo=27718]: Fix help for the
signal
module. Some functions (e.g.signal()
andgetsignal()
) were omitted.bpo-46032 [https://bugs.python.org/issue?@action=redirect&bpo=46032]: The
registry()
method offunctools.singledispatch()
functions checks now the first argument or the first parameter annotation and raises a TypeError if it is not supported. Previously unsupported "types" were ignored (e.g.typing.List[int]
) or caused an error at calling time (e.g.list[int]
).bpo-46014 [https://bugs.python.org/issue?@action=redirect&bpo=46014]: Add ability to use
typing.Union
andtypes.UnionType
as dispatch argument tofunctools.singledispatch
. Patch provided by Yurii Karabas.bpo-27062 [https://bugs.python.org/issue?@action=redirect&bpo=27062]: Add
__all__
toinspect
, patch by Kumar Aditya.bpo-46018 [https://bugs.python.org/issue?@action=redirect&bpo=46018]: Ensure that
math.expm1()
does not raise on underflow.bpo-46016 [https://bugs.python.org/issue?@action=redirect&bpo=46016]: Adding
F_DUP2FD
andF_DUP2FD_CLOEXEC
constants from FreeBSD into thefcntl
module.bpo-45755 [https://bugs.python.org/issue?@action=redirect&bpo=45755]:
typing
generic aliases now reveal the class attributes of the original generic class when passed todir()
. This was the behavior up to Python 3.6, but was changed in 3.7-3.9.bpo-45874 [https://bugs.python.org/issue?@action=redirect&bpo=45874]: The empty query string, consisting of no query arguments, is now handled correctly in
urllib.parse.parse_qsl
. This caused problems before when strict parsing was enabled.bpo-44674 [https://bugs.python.org/issue?@action=redirect&bpo=44674]: Change how dataclasses disallows mutable default values. It used to use a list of known types (list, dict, set). Now it disallows unhashable objects to be defaults. It's using unhashability as a proxy for mutability. Patch by Eric V. Smith, idea by Raymond Hettinger.
bpo-23882 [https://bugs.python.org/issue?@action=redirect&bpo=23882]: Remove namespace package (PEP 420) support from unittest discovery. It was introduced in Python 3.4 but has been broken since Python 3.7.
bpo-25066 [https://bugs.python.org/issue?@action=redirect&bpo=25066]: Added a
_repr_()
method tomultiprocessing.Event
objects, patch by Kumar Aditya.bpo-45643 [https://bugs.python.org/issue?@action=redirect&bpo=45643]: Added
signal.SIGSTKFLT
on platforms where this signal is defined.bpo-44092 [https://bugs.python.org/issue?@action=redirect&bpo=44092]: Fetch across rollback no longer raises
InterfaceError
. Instead we leave it to the SQLite library to handle these cases. Patch by Erlend E. Aasland.bpo-42413 [https://bugs.python.org/issue?@action=redirect&bpo=42413]: Replace
concurrent.futures.TimeoutError
andasyncio.TimeoutError
with builtinTimeoutError
, keep these names as deprecated aliases.
文档
bpo-46196 [https://bugs.python.org/issue?@action=redirect&bpo=46196]: Document method
cmd.Cmd.columnize()
.bpo-46120 [https://bugs.python.org/issue?@action=redirect&bpo=46120]: State that
|
is preferred for readability overUnion
in thetyping
docs.bpo-46109 [https://bugs.python.org/issue?@action=redirect&bpo=46109]: Extracted
importlib.resources
andimportlib.resources.abc
documentation into separate files.bpo-19737 [https://bugs.python.org/issue?@action=redirect&bpo=19737]: Update the documentation for the
globals()
function.
测试
bpo-46296 [https://bugs.python.org/issue?@action=redirect&bpo=46296]: Add a test case for
enum
withuseargs_ == True
andmembertype_ == object
.bpo-46205 [https://bugs.python.org/issue?@action=redirect&bpo=46205]: Fix hang in runtest_mp due to race condition
bpo-46263 [https://bugs.python.org/issue?@action=redirect&bpo=46263]: Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory with junk byte.
bpo-46262 [https://bugs.python.org/issue?@action=redirect&bpo=46262]: Cover
ValueError
path in tests forenum.Flag.missing()
.bpo-46150 [https://bugs.python.org/issue?@action=redirect&bpo=46150]: Now
fakename
intest_pathlib.PosixPathTest.test_expanduser
is checked to be nonexistent.bpo-46129 [https://bugs.python.org/issue?@action=redirect&bpo=46129]: Rewrite
asyncio.locks
tests withunittest.IsolatedAsyncioTestCase
usage.bpo-23819 [https://bugs.python.org/issue?@action=redirect&bpo=23819]: Fixed
asyncio
tests in python optimized mode. Patch by Kumar Aditya.bpo-46114 [https://bugs.python.org/issue?@action=redirect&bpo=46114]: Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses
0xMNN00PP0L
.