构建
bpo-44133 [https://bugs.python.org/issue?@action=redirect&bpo=44133]: When Python is configured with
--without-static-libpython
, the Python static library (libpython.a) is no longer built. Patch by Victor Stinner.bpo-44133 [https://bugs.python.org/issue?@action=redirect&bpo=44133]: When Python is built without
--enable-shared
, thepython
program is now linked to object files, rather than being linked to the Python static library (libpython.a), to make sure that all symbols are exported. Previously, the linker omitted some symbols like thePy_FrozenMain()
function. Patch by Victor Stinner.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: The
configure
script has a new option--with-emscripten-target
to select browser or node as Emscripten build target.bpo-46315 [https://bugs.python.org/issue?@action=redirect&bpo=46315]: Added and fixed
#ifdef HAVE_FEATURE
checks for functionality that is not available on WASI platform.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]: Fixed a regression in
configure
check forselect.epoll()
.bpo-46263 [https://bugs.python.org/issue?@action=redirect&bpo=46263]:
configure
no longer setsMULTIARCH
on FreeBSD platforms.bpo-46106 [https://bugs.python.org/issue?@action=redirect&bpo=46106]: Updated OpenSSL to 1.1.1m in Windows builds, macOS installer builds, and CI. Patch by Kumar Aditya.
bpo-46088 [https://bugs.python.org/issue?@action=redirect&bpo=46088]: Automatically detect or install bootstrap Python runtime when building from Visual Studio.
bpo-46072 [https://bugs.python.org/issue?@action=redirect&bpo=46072]: Add a —with-pystats configure option to turn on internal statistics gathering.
bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: A new directory
Tools/wasm
contains WebAssembly-related helpers likeconfig.site
override for wasm32-emscripten, wasm assets generator to bundle the stdlib, and a README.bpo-46023 [https://bugs.python.org/issue?@action=redirect&bpo=46023]: makesetup no longer builds extensions that have been marked as disabled. This allows users to disable modules in
Modules/Setup.local
.bpo-45949 [https://bugs.python.org/issue?@action=redirect&bpo=45949]: Use pure Python
freeze_module
for all but importlib bootstrap files.--with-freeze-module
configure option is no longer needed for cross builds.
Windows
- bpo-46217 [https://bugs.python.org/issue?@action=redirect&bpo=46217]: Removed parameter that is unsupported on Windows 8.1 and early Windows 10 and may have caused build or runtime failures.
macOS
- bpo-40477 [https://bugs.python.org/issue?@action=redirect&bpo=40477]: The Python Launcher app for macOS now properly launches scripts and, if necessary, the Terminal app when running on recent macOS releases.
C API
bpo-46236 [https://bugs.python.org/issue?@action=redirect&bpo=46236]: Fix a bug in
PyFunction_GetAnnotations()
that caused it to return atuple
instead of adict
.bpo-46140 [https://bugs.python.org/issue?@action=redirect&bpo=46140]:
PyBuffer_GetPointer()
,PyBuffer_FromContiguous()
,PyBuffer_ToContiguous()
andPyMemoryView_FromBuffer()
now take buffer info byconst Py_buffer *
instead ofPy_buffer *
, as they do not need mutability.PyBuffer_FromContiguous()
also now takes the source buffer asconst void *
, and similarlyPyBuffer_GetPointer()
takes the strides asconst Py_ssize_t *
.bpo-45855 [https://bugs.python.org/issue?@action=redirect&bpo=45855]: Document that the no_block argument to
PyCapsule_Import()
is a no-op now.bpo-45855 [https://bugs.python.org/issue?@action=redirect&bpo=45855]: Replaced deprecated usage of
PyImport_ImportModuleNoBlock()
withPyImport_ImportModule()
in stdlib modules. Patch by Kumar Aditya.bpo-46007 [https://bugs.python.org/issue?@action=redirect&bpo=46007]: The
PyUnicodeCHECKINTERNED()
macro has been excluded from the limited C API. It was never usable there, because it used internal structures which are not available in the limited C API. Patch by Victor Stinner.
Python 3.11.0 alpha 3
Release date: 2021-12-08
核心与内置函数
bpo-46009 [https://bugs.python.org/issue?@action=redirect&bpo=46009]: Restore behavior from 3.9 and earlier when sending non-None to newly started generator. In 3.9 this did not affect the state of the generator. In 3.10.0 and 3.10.1
gen_func().send(0)
is equivalent togen_func().throw(TypeError(…)
which exhausts the generator. In 3.10.2 onward, the behavior has been reverted to that of 3.9.bpo-46004 [https://bugs.python.org/issue?@action=redirect&bpo=46004]: Fix the
SyntaxError
location for errors involving for loops with invalid targets. Patch by Pablo Galindobpo-45711 [https://bugs.python.org/issue?@action=redirect&bpo=45711]:
PyErrChainStackItem()
no longer normalizesexc_info
(including setting the traceback on the exception instance) becauseexc_info
is always normalized.bpo-45607 [https://bugs.python.org/issue?@action=redirect&bpo=45607]: The
__note__
field was added toBaseException
. It isNone
by default but can be set to a string which is added to the exception's traceback.bpo-45947 [https://bugs.python.org/issue?@action=redirect&bpo=45947]: Place pointers to dict and values immediately before GC header. This reduces number of dependent memory loads to access either dict or values from 3 to 1.
bpo-45915 [https://bugs.python.org/issue?@action=redirect&bpo=45915]:
is_valid_fd
now uses fasterfcntl(fd, F_GETFD)
on Linux, macOS, and Windows.bpo-44530 [https://bugs.python.org/issue?@action=redirect&bpo=44530]: Reverts a change to the
code._new_
audit event from an earlier prerelease.bpo-42268 [https://bugs.python.org/issue?@action=redirect&bpo=42268]: Fail the configure step if the selected compiler doesn't support memory sanitizer. Patch by Pablo Galindo
bpo-45711 [https://bugs.python.org/issue?@action=redirect&bpo=45711]: The three values of
exc_info
are now always consistent with each other. In particular, thetype
andtraceback
fields are now derived from the exception instance. This impacts the return values ofsys.exc_info()
andPyErr_GetExcInfo()
if the exception instance is modified while the exception is handled, as well asPyErr_SetExcInfo()
, which now ignores thetype
andtraceback
arguments provided to it.bpo-45727 [https://bugs.python.org/issue?@action=redirect&bpo=45727]: Refine the custom syntax error that suggests that a comma may be missing to trigger only when the expressions are detected between parentheses or brackets. Patch by Pablo Galindo
bpo-45885 [https://bugs.python.org/issue?@action=redirect&bpo=45885]: Specialized the
COMPARE_OP
opcode using the PEP 659 machinery.bpo-45786 [https://bugs.python.org/issue?@action=redirect&bpo=45786]: Allocate space for the interpreter frame in the frame object, to avoid an additional allocation when the frame object outlives the frame activation.
bpo-45614 [https://bugs.python.org/issue?@action=redirect&bpo=45614]: Fix
traceback
display for exceptions with invalid module name.bpo-45813 [https://bugs.python.org/issue?@action=redirect&bpo=45813]: Fix crash when calling coro.cr_frame.clear() after coroutine has been freed.
bpo-45811 [https://bugs.python.org/issue?@action=redirect&bpo=45811]: Improve the tokenizer errors when encountering invisible control characters in the parser. Patch by Pablo Galindo
bpo-45848 [https://bugs.python.org/issue?@action=redirect&bpo=45848]: Allow the parser to obtain error lines directly from encoded files. Patch by Pablo Galindo
bpo-45709 [https://bugs.python.org/issue?@action=redirect&bpo=45709]: Restore behavior from 3.10 when tracing an exception raised within a with statement.
bpo-44525 [https://bugs.python.org/issue?@action=redirect&bpo=44525]: Adds new
COPY_FREE_VARS
opcode, to make copying of free variables from function to frame explicit. Helps optimization of calls to Python function.bpo-45829 [https://bugs.python.org/issue?@action=redirect&bpo=45829]: Specialize
BINARY_SUBSCR
for classes with a__getitem__
method implemented in Pythonbpo-45826 [https://bugs.python.org/issue?@action=redirect&bpo=45826]: Fixed a crash when calling
.with_traceback(None)
onNameError
. This occurs internally inunittest.TestCase.assertRaises()
.bpo-45822 [https://bugs.python.org/issue?@action=redirect&bpo=45822]: Fixed a bug in the parser that was causing it to not respect PEP 263 [https://peps.python.org/pep-0263/] coding cookies when no flags are provided. Patch by Pablo Galindo
bpo-45820 [https://bugs.python.org/issue?@action=redirect&bpo=45820]: Fix a segfault when the parser fails without reading any input. Patch by Pablo Galindo
bpo-45636 [https://bugs.python.org/issue?@action=redirect&bpo=45636]: Simplify the implementation of
BINARY_OP
by indexing into an array of function pointers (rather than switching on the oparg).bpo-42540 [https://bugs.python.org/issue?@action=redirect&bpo=42540]: Fix crash when
os.fork()
is called with an active non-default memory allocator.bpo-45738 [https://bugs.python.org/issue?@action=redirect&bpo=45738]: Fix computation of error location for invalid continuation characters in the parser. Patch by Pablo Galindo.
bpo-45636 [https://bugs.python.org/issue?@action=redirect&bpo=45636]: Remove an existing "fast path" for old-style string formatting, since it no longer appears to have any measurable impact.
bpo-45753 [https://bugs.python.org/issue?@action=redirect&bpo=45753]: Make recursion checks a bit more efficient by tracking amount of calls left before overflow.
bpo-45773 [https://bugs.python.org/issue?@action=redirect&bpo=45773]: Fix a compiler hang when attempting to optimize certain jump patterns.
bpo-45764 [https://bugs.python.org/issue?@action=redirect&bpo=45764]: The parser now gives a better error message when leaving out the opening parenthesis
(
after adef
-statement:
- >>> def f:
- File "<stdin>", line 1 def f: ^
- SyntaxError: expected '('
bpo-45609 [https://bugs.python.org/issue?@action=redirect&bpo=45609]: Specialized the
STORE_SUBSCR
opcode using the PEP 659 machinery.bpo-45636 [https://bugs.python.org/issue?@action=redirect&bpo=45636]: Replace all numeric
BINARY_*
andINPLACE_*
instructions with a singleBINARY_OP
implementation.bpo-45582 [https://bugs.python.org/issue?@action=redirect&bpo=45582]: Path calculation (known as
getpath
) has been reimplemented as a frozen Python module. This should have no visible impact, but may affect calculation of all paths referenced insys
andsysconfig
.bpo-45450 [https://bugs.python.org/issue?@action=redirect&bpo=45450]: Improve the syntax error message for parenthesized arguments. Patch by Pablo Galindo.
库
bpo-27946 [https://bugs.python.org/issue?@action=redirect&bpo=27946]: Fix possible crash when getting an attribute of
xml.etree.ElementTree.Element
simultaneously with replacing theattrib
dict.bpo-45711 [https://bugs.python.org/issue?@action=redirect&bpo=45711]: Make
asyncio
normalize exceptions as soon as they are captured withPyErr_Fetch()
, and before they are stored as an exc_info triplet. This bringsasyncio
in line with the rest of the codebase, where an exc_info triplet is always normalized.bpo-23819 [https://bugs.python.org/issue?@action=redirect&bpo=23819]: Replaced asserts with exceptions in asyncio, patch by Kumar Aditya.
bpo-13236 [https://bugs.python.org/issue?@action=redirect&bpo=13236]:
unittest.TextTestResult
andunittest.TextTestRunner
flush now the output stream more often.bpo-45917 [https://bugs.python.org/issue?@action=redirect&bpo=45917]: Added
math.exp2()
:, which returns 2 raised to the power of x.bpo-37658 [https://bugs.python.org/issue?@action=redirect&bpo=37658]: Fix issue when on certain conditions
asyncio.wait_for()
may allow a coroutine to complete successfully, but fail to return the result, potentially causing memory leaks or other issues.bpo-45876 [https://bugs.python.org/issue?@action=redirect&bpo=45876]: Improve the accuracy of stdev() and pstdev() in the statistics module. When the inputs are floats or fractions, the output is a correctly rounded float
bpo-44649 [https://bugs.python.org/issue?@action=redirect&bpo=44649]: Handle dataclass(slots=True) with a field that has default a default value, but for which init=False.
bpo-45803 [https://bugs.python.org/issue?@action=redirect&bpo=45803]: Added missing kw_only parameter to dataclasses.make_dataclass().
bpo-45837 [https://bugs.python.org/issue?@action=redirect&bpo=45837]: The
turtle.RawTurtle.settiltangle()
is deprecated since Python 3.1, it now emits a deprecation warning and will be removed in Python 3.13.
Use turtle.RawTurtle.tiltangle()
instead.
turtle.RawTurtle.tiltangle()
was earlier incorrectly marked as deprecated, its docstring has been corrected.
Patch by Hugo van Kemenade.
bpo-45831 [https://bugs.python.org/issue?@action=redirect&bpo=45831]:
faulthandler
can now write ASCII-only strings (like filenames and function names) with a single write() syscall when dumping a traceback. It reduces the risk of getting an unreadable dump when two threads or two processes dump a traceback to the same file (like stderr) at the same time. Patch by Victor Stinner.bpo-45828 [https://bugs.python.org/issue?@action=redirect&bpo=45828]:
sqlite
C callbacks now use unraisable exceptions if callback tracebacks are enabled. Patch by Erlend E. Aasland.bpo-41735 [https://bugs.python.org/issue?@action=redirect&bpo=41735]: Fix thread lock in
zlib.Decompress.flush()
method beforePyObject_GetBuffer
.bpo-45235 [https://bugs.python.org/issue?@action=redirect&bpo=45235]: Reverted an argparse bugfix that caused regression in the handling of default arguments for subparsers. This prevented leaf level arguments from taking precedence over root level arguments.
bpo-45754 [https://bugs.python.org/issue?@action=redirect&bpo=45754]: Fix a regression in Python 3.11a1 and 3.11a2 where
sqlite3
incorrectly would useSQLITE_LIMIT_LENGTH
when checking SQL statement lengths. Now,SQLITE_LIMIT_SQL_LENGTH
is used. Patch by Erlend E. Aasland.bpo-45766 [https://bugs.python.org/issue?@action=redirect&bpo=45766]: Added proportional option to
statistics.linear_regression()
.bpo-45765 [https://bugs.python.org/issue?@action=redirect&bpo=45765]: In importlib.metadata, fix distribution discovery for an empty path.
bpo-45757 [https://bugs.python.org/issue?@action=redirect&bpo=45757]: Fix bug where
dis
produced an incorrect oparg whenEXTENDED_ARG
is followed by an opcode that does not use its argument.bpo-45644 [https://bugs.python.org/issue?@action=redirect&bpo=45644]: Inplace JSON file formatting using
python3 -m json.tool infile infile
now works correctly, previously it left the file empty. Patch by Chris Wesseling.bpo-45703 [https://bugs.python.org/issue?@action=redirect&bpo=45703]: When a namespace package is imported before another module from the same namespace is created/installed in a different
sys.path
location while the program is running, calling theimportlib.invalidate_caches()
function will now also guarantee the new module is noticed.bpo-45535 [https://bugs.python.org/issue?@action=redirect&bpo=45535]: Improve output of
dir()
with Enums.bpo-45664 [https://bugs.python.org/issue?@action=redirect&bpo=45664]: Fix
types.resolve_bases()
andtypes.new_class()
fortypes.GenericAlias
instance as a base.bpo-45663 [https://bugs.python.org/issue?@action=redirect&bpo=45663]: Fix
dataclasses.is_dataclass()
for dataclasses which are subclasses oftypes.GenericAlias
.bpo-45662 [https://bugs.python.org/issue?@action=redirect&bpo=45662]: Fix the repr of
dataclasses.InitVar
with a type alias to the builtin class, e.g.InitVar[list[int]]
.bpo-43137 [https://bugs.python.org/issue?@action=redirect&bpo=43137]: Launch GNOME web browsers via gio tool instead of obsolete gvfs-open
bpo-45429 [https://bugs.python.org/issue?@action=redirect&bpo=45429]: On Windows,
time.sleep()
now uses a waitable timer which supports high-resolution timers. Patch by Donghee Na and Eryk Sun.bpo-37295 [https://bugs.python.org/issue?@action=redirect&bpo=37295]: Optimize
math.comb()
andmath.perm()
.bpo-45514 [https://bugs.python.org/issue?@action=redirect&bpo=45514]: Deprecated legacy functions in
importlib.resources
.bpo-45507 [https://bugs.python.org/issue?@action=redirect&bpo=45507]: Add tests for truncated/missing trailers in gzip.decompress implementation.
bpo-45359 [https://bugs.python.org/issue?@action=redirect&bpo=45359]: Implement PEP 585 [https://peps.python.org/pep-0585/] for
graphlib.TopologicalSorter
.bpo-44733 [https://bugs.python.org/issue?@action=redirect&bpo=44733]: Add
max_tasks_per_child
toconcurrent.futures.ProcessPoolExecutor
. This allows users to specify the maximum number of tasks a single process should execute before the process needs to be restarted.bpo-28806 [https://bugs.python.org/issue?@action=redirect&bpo=28806]: Improve netrc library. netrc file no longer needs to contain all tokens. And if the login name is anonymous, security check is no longer need.
bpo-43498 [https://bugs.python.org/issue?@action=redirect&bpo=43498]: Avoid a possible "RuntimeError: dictionary changed size during iteration" when adjusting the process count of
ProcessPoolExecutor
.bpo-42158 [https://bugs.python.org/issue?@action=redirect&bpo=42158]: Add MIME types for N-quads, N-triples, Notation3 and TriG to
mimetypes
.bpo-30533 [https://bugs.python.org/issue?@action=redirect&bpo=30533]: Add
inspect.getmembers_static()
, it return all members without triggering dynamic lookup via the descriptor protocol. Patch by Weipeng Hong.
文档
bpo-42238 [https://bugs.python.org/issue?@action=redirect&bpo=42238]:
make -C Doc suspicious
will be removed soon in favor ofmake -C Doc check
, mark it as deprecated.bpo-45840 [https://bugs.python.org/issue?@action=redirect&bpo=45840]: Improve cross-references in the documentation for the data model.
bpo-45640 [https://bugs.python.org/issue?@action=redirect&bpo=45640]: Properly marked-up grammar tokens in the documentation are now clickable and take you to the definition of a given piece of grammar. Patch by Arthur Milchior.
bpo-45788 [https://bugs.python.org/issue?@action=redirect&bpo=45788]: Link doc for sys.prefix to sysconfig doc on installation paths.
bpo-45772 [https://bugs.python.org/issue?@action=redirect&bpo=45772]:
socket.socket
documentation is corrected to a class from a function.bpo-45392 [https://bugs.python.org/issue?@action=redirect&bpo=45392]: Update the docstring of the
type
builtin to remove a redundant line and to mention keyword arguments for the constructor.bpo-45250 [https://bugs.python.org/issue?@action=redirect&bpo=45250]: Update the documentation to note that CPython does not consistently require iterators to define
__iter__
.bpo-25381 [https://bugs.python.org/issue?@action=redirect&bpo=25381]: In the extending chapter of the extending doc, update a paragraph about the global variables containing exception information.
bpo-43905 [https://bugs.python.org/issue?@action=redirect&bpo=43905]: Expanded
astuple()
andasdict()
docs, warning about deepcopy being applied and providing a workaround.
测试
bpo-45695 [https://bugs.python.org/issue?@action=redirect&bpo=45695]: Out-of-tree builds with a readonly source directory are now tested by CI.
bpo-19460 [https://bugs.python.org/issue?@action=redirect&bpo=19460]: Add new Test for
Lib/email/mime/nonmultipart.py::MIMENonMultipart
.bpo-45835 [https://bugs.python.org/issue?@action=redirect&bpo=45835]: Fix race condition in test_queue tests with multiple "feeder" threads.
bpo-45783 [https://bugs.python.org/issue?@action=redirect&bpo=45783]: The test for the freeze tool now handles file moves and deletions.
bpo-45745 [https://bugs.python.org/issue?@action=redirect&bpo=45745]: Remove the
--findleaks
command line option of regrtest: use the--fail-env-changed
option instead. Since Python 3.7, it was a deprecated alias to the--fail-env-changed
option.bpo-45701 [https://bugs.python.org/issue?@action=redirect&bpo=45701]: Add tests with
tuple
type withfunctools.lru_cache()
totest_functools
.
构建
bpo-44035 [https://bugs.python.org/issue?@action=redirect&bpo=44035]: CI now verifies that autoconf files have been regenerated with a current and unpatched autoconf package.
bpo-45950 [https://bugs.python.org/issue?@action=redirect&bpo=45950]: The build system now uses a bootstrappython interpreter for freezing and deepfreezing again. To speed up build process the build tools bootstrappython and freezemodule are no longer build with LTO.
bpo-45881 [https://bugs.python.org/issue?@action=redirect&bpo=45881]: The configure script now accepts
--with-build-python
and--with-freeze-module
options to make cross compiling easier.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: Emscripten platform now uses
.wasm
suffix by default.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]: Disable unusable core extension modules on WASM/Emscripten targets.
bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]:
configure
now checks for socketshutdown
function. The check makes it possible to disableSYS_shutdown
withac_cv_func_shutdown=no
in CONFIG_SITE.bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]:
configure
now checks for functionsfork1, getegid, geteuid, getgid, getppid, getuid, opendir, pipe, system, wait, ttyname
.bpo-33393 [https://bugs.python.org/issue?@action=redirect&bpo=33393]: Update
config.guess
to 2021-06-03 andconfig.sub
to 2021-08-14.Makefile
now has anupdate-config
target to make updating more convenient.bpo-45866 [https://bugs.python.org/issue?@action=redirect&bpo=45866]:
make regen-all
now produces the same output when run from a directory other than the source tree: when building Python out of the source tree. pegen now strips directory of the "generated by pygen from" header Patch by Victor Stinner. bpo-40280 [https://bugs.python.org/issue?@action=redirect&bpo=40280]:
configure
now accepts machinewasm32
orwasm64
and OSwasi
oremscripten
for cross building, e.g.wasm32-unknown-emscripten
,wasm32-wasi
, orwasm32-unknown-wasi
.bpo-41498 [https://bugs.python.org/issue?@action=redirect&bpo=41498]: Python now compiles on platforms without
sigset_t
. Several functions insignal
are not available whensigset_t
is missing.
Based on patch by Roman Yurchak for pyodide.
bpo-45881 [https://bugs.python.org/issue?@action=redirect&bpo=45881]:
setup.py
now usesCC
from environment first to discover multiarch and cross compile paths.bpo-45886 [https://bugs.python.org/issue?@action=redirect&bpo=45886]: The
freezemodule
program path can now be overridden on the command line, e.g.make FREEZE_MODULE=../x86_64/Program/freezemodule
.bpo-45873 [https://bugs.python.org/issue?@action=redirect&bpo=45873]: Get rid of the
bootstrappython
build step. The deepfreeze.py script is now run using$(PYTHON_FOR_REGEN)
which can be Python 3.7 or newer (on Windows, 3.8 or newer).bpo-45847 [https://bugs.python.org/issue?@action=redirect&bpo=45847]: Port builtin hashlib extensions to
PY_STDLIB_MOD
macro andaddext()
.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]: Add
autoconf
helpers for saving and restoring environment variables:SAVE_ENV
: Save$CFLAGS
,$LDFLAGS
,$LIBS
, and$CPPFLAGS
.RESTORE_ENV
: Restore$CFLAGS
,$LDFLAGS
,$LIBS
, and$CPPFLAGS
.WITH_SAVE_ENV([SCRIPT])
: RunSCRIPT
wrapped withSAVE_ENV
andRESTORE_ENV
.
Patch by Erlend E. Aasland.
bpo-45573 [https://bugs.python.org/issue?@action=redirect&bpo=45573]: Mandatory core modules, that are required to bootstrap Python, are now in
Modules/Setup.bootstrap
.bpo-45573 [https://bugs.python.org/issue?@action=redirect&bpo=45573]:
configure
now createsModules/Setup.stdlib
with conditionally enabled/disabled extension module lines. The file is not used, yet.bpo-45573 [https://bugs.python.org/issue?@action=redirect&bpo=45573]:
configure
now uses a unified format to set state, compiler flags, and linker flags in Makefile. The new macroPY_STDLIB_MOD
sets three variables that are consumed byModules/Setup
andsetup.py
.bpo-45816 [https://bugs.python.org/issue?@action=redirect&bpo=45816]: Python now supports building with Visual Studio 2022 (MSVC v143, VS Version 17.0). Patch by Jeremiah Vivian.
bpo-45800 [https://bugs.python.org/issue?@action=redirect&bpo=45800]: Settings for
pyexpat
C extension are now detected byconfigure
. The bundledexpat
library is built inMakefile
.bpo-45798 [https://bugs.python.org/issue?@action=redirect&bpo=45798]: Settings for
decimal
internal C extension are now detected byconfigure
. The bundledlibmpdec
library is built inMakefile
.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]: configure has a new option
--with-pkg-config
to disable or require pkg-config.bpo-45774 [https://bugs.python.org/issue?@action=redirect&bpo=45774]: The build dependencies for
sqlite3
are now detected byconfigure
andpkg-config
. Patch by Erlend E. Aasland.bpo-45763 [https://bugs.python.org/issue?@action=redirect&bpo=45763]: The build dependencies for
zlib
,bz2
, andlzma
are now detected byconfigure
.bpo-45747 [https://bugs.python.org/issue?@action=redirect&bpo=45747]: gdbm and dbm build dependencies are now detected by
configure
.bpo-45743 [https://bugs.python.org/issue?@action=redirect&bpo=45743]: On macOS, the build system no longer passes
search_paths_first
to the linker. The flag has been the default since Xcode 4 / macOS 10.6.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]:
configure.ac
is now compatible with autoconf 2.71. Deprecated checksSTDC_HEADERS
andAC_HEADER_TIME
have been removed.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]:
configure
now prints a warning when pkg-config is missing.bpo-45731 [https://bugs.python.org/issue?@action=redirect&bpo=45731]:
configure --enable-loadable-sqlite-extensions
is now handled by newPY_SQLITE_ENABLE_LOAD_EXTENSION
macro instead of logic in setup.py.bpo-45723 [https://bugs.python.org/issue?@action=redirect&bpo=45723]: configure.ac now uses custom helper macros and
AC_CACHE_CHECK
to simplify and speed up configure runs.bpo-45696 [https://bugs.python.org/issue?@action=redirect&bpo=45696]: Skip the marshal step for frozen modules by generating C code that produces a set of ready-to-use code objects. This speeds up startup time by another 10% or more.
bpo-45561 [https://bugs.python.org/issue?@action=redirect&bpo=45561]: Run smelly.py tool from $(srcdir).
Windows
bpo-46105 [https://bugs.python.org/issue?@action=redirect&bpo=46105]: Fixed calculation of
sys.path
in a venv on Windows.bpo-45901 [https://bugs.python.org/issue?@action=redirect&bpo=45901]: When installed through the Microsoft Store and set as the default app for
*.py
files, command line arguments will now be passed to Python when invoking a script without explicitly launching Python (that is,script.py args
rather thanpython script.py args
).bpo-45616 [https://bugs.python.org/issue?@action=redirect&bpo=45616]: Fix Python Launcher's ability to distinguish between versions 3.1 and 3.10 when either one is explicitly requested. Previously, 3.1 would be used if 3.10 was requested but not installed, and 3.10 would be used if 3.1 was requested but 3.10 was installed.
bpo-45850 [https://bugs.python.org/issue?@action=redirect&bpo=45850]: Implement changes to build with deep-frozen modules on Windows. Note that we now require Python 3.10 as the "bootstrap" or "host" Python.
bpo-45732 [https://bugs.python.org/issue?@action=redirect&bpo=45732]: Updates bundled Tcl/Tk to 8.6.12.
bpo-45720 [https://bugs.python.org/issue?@action=redirect&bpo=45720]: Internal reference to
shlwapi.dll
was dropped to help improve startup time. This DLL will no longer be loaded at the start of every Python process.
macOS
- bpo-45732 [https://bugs.python.org/issue?@action=redirect&bpo=45732]: Update python.org macOS installer to use Tcl/Tk 8.6.12.
C API
- bpo-39026 [https://bugs.python.org/issue?@action=redirect&bpo=39026]: Fix Python.h to build C extensions with Xcode: remove a relative include from
Include/cpython/pystate.h
.
Python 3.11.0 alpha 2
Release date: 2021-11-05
核心与内置函数
bpo-45716 [https://bugs.python.org/issue?@action=redirect&bpo=45716]: Improve the
SyntaxError
message when usingTrue
,None
orFalse
as keywords in a function call. Patch by Pablo Galindo.bpo-45688 [https://bugs.python.org/issue?@action=redirect&bpo=45688]:
sys.stdlib_module_names
now contains the macOS-specific module_scproxy
.bpo-45379 [https://bugs.python.org/issue?@action=redirect&bpo=45379]: Clarify
ImportError
message when we try to explicitly import a frozen module but frozen modules are disabled.bpo-44525 [https://bugs.python.org/issue?@action=redirect&bpo=44525]: Specialize simple calls to Python functions (no starargs, keyword dict, or closure)
bpo-45530 [https://bugs.python.org/issue?@action=redirect&bpo=45530]: Cases of sorting using tuples as keys may now be significantly faster in some cases. Patch by Tim Peters.
The order of the result may differ from earlier releases if the tuple elements don't define a total ordering (see 值比较 for information on total ordering). It's generally true that the result of sorting simply isn't well-defined in the absence of a total ordering on list elements.
bpo-45526 [https://bugs.python.org/issue?@action=redirect&bpo=45526]: In obmalloc, set ADDRESS_BITS to not ignore any bits (ignored 16 before). That is safer in the case that the kernel gives user-space virtual addresses that span a range greater than 48 bits.
bpo-30570 [https://bugs.python.org/issue?@action=redirect&bpo=30570]: Fixed a crash in
issubclass()
from infinite recursion when searching pathological__bases__
tuples.bpo-45521 [https://bugs.python.org/issue?@action=redirect&bpo=45521]: Fix a bug in the obmalloc radix tree code. On 64-bit machines, the bug causes the tree to hold 46-bits of virtual addresses, rather than the intended 48-bits.
bpo-45494 [https://bugs.python.org/issue?@action=redirect&bpo=45494]: Fix parser crash when reporting errors involving invalid continuation characters. Patch by Pablo Galindo.
bpo-45445 [https://bugs.python.org/issue?@action=redirect&bpo=45445]: Python now fails to initialize if it finds an invalid
-X
option in the command line. Patch by Pablo Galindo.bpo-45340 [https://bugs.python.org/issue?@action=redirect&bpo=45340]: Object attributes are held in an array instead of a dictionary. An object's dictionary are created lazily, only when needed. Reduces the memory consumption of a typical Python object by about 30%. Patch by Mark Shannon.
bpo-45408 [https://bugs.python.org/issue?@action=redirect&bpo=45408]: Fix a crash in the parser when reporting tokenizer errors that occur at the same time unclosed parentheses are detected. Patch by Pablo Galindo.
bpo-29410 [https://bugs.python.org/issue?@action=redirect&bpo=29410]: Add SipHash13 for string hash algorithm and use it by default.
bpo-45385 [https://bugs.python.org/issue?@action=redirect&bpo=45385]: Fix reference leak from descr_check. Patch by Donghee Na.
bpo-45367 [https://bugs.python.org/issue?@action=redirect&bpo=45367]: Specialized the
BINARY_MULTIPLY
opcode toBINARY_MULTIPLY_INT
andBINARY_MULTIPLY_FLOAT
using the PEP 659 machinery.bpo-21736 [https://bugs.python.org/issue?@action=redirect&bpo=21736]: Frozen stdlib modules now have
__file__
to the .py file they would otherwise be loaded from, if possible. For packages,__path__
now has the correct entry instead of being an empty list, which allows unfrozen submodules to be imported. These are set only if the stdlib directory is known when the runtime is initialized. Note that the file at__file__
is not guaranteed to exist. None of this affects non-stdlib frozen modules nor, for now, frozen modules imported usingPyImport_ImportFrozenModule()
. Also, at the momentco_filename
is not updated for the module.bpo-45020 [https://bugs.python.org/issue?@action=redirect&bpo=45020]: For frozen stdlib modules, record the original module name as
module.__spec__.loader_state.origname
. If the value is different thanmodule.__spec__.name
then the module was defined as an alias in Tools/scripts/freeze_modules.py. If it isNone
then the module comes from a source file outside the stdlib.bpo-45324 [https://bugs.python.org/issue?@action=redirect&bpo=45324]: In FrozenImporter.find_spec(), we now preserve the information needed in exec_module() to load the module. This change mostly impacts internal details, rather than changing the importer's behavior.
bpo-45292 [https://bugs.python.org/issue?@action=redirect&bpo=45292]: Implement PEP 654 [https://peps.python.org/pep-0654/]. Add
ExceptionGroup
andBaseExceptionGroup
. Update traceback display code.bpo-40116 [https://bugs.python.org/issue?@action=redirect&bpo=40116]: Change to the implementation of split dictionaries. Classes where the instances differ either in the exact set of attributes, or in the order in which those attributes are set, can still share keys. This should have no observable effect on users of Python or the C-API. Patch by Mark Shannon.
bpo-44050 [https://bugs.python.org/issue?@action=redirect&bpo=44050]: Extensions that indicate they use global state (by setting
m_size
to -1) can again be used in multiple interpreters. This reverts to behavior of Python 3.8.bpo-44525 [https://bugs.python.org/issue?@action=redirect&bpo=44525]: Setup initial specialization infrastructure for the
CALL_FUNCTION
opcode. Implemented initial specializations for C function calls:CALL_FUNCTION_BUILTIN_O
forMETH_O
flag.CALL_FUNCTION_BUILTIN_FAST
forMETH_FASTCALL
flag without keywords.CALL_FUNCTION_LEN
forlen(o)
.CALL_FUNCTION_ISINSTANCE
forisinstance(o, t)
.
bpo-44511 [https://bugs.python.org/issue?@action=redirect&bpo=44511]: Improve the generated bytecode for class and mapping patterns.
bpo-43706 [https://bugs.python.org/issue?@action=redirect&bpo=43706]: Speed up calls to
enumerate()
by using the PEP 590 [https://peps.python.org/pep-0590/]vectorcall
calling convention. Patch by Donghee Na.