Skip to content

Commit f59c749

Browse files
authored
Merge branch 'main' into test/executor-map-ref-cycles
2 parents 48ed15d + c432d01 commit f59c749

File tree

193 files changed

+2563
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2563
-963
lines changed

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
set PlatformToolset=clangcl
8888
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
8989
set LLVMInstallDir=C:\Program Files\LLVM
90-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
90+
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91+
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9292
9393
# No tests (yet):
9494
- name: Emulated Windows (release)

Doc/library/os.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,16 +3693,16 @@ features:
36933693

36943694
This example displays the number of bytes taken by non-directory files in each
36953695
directory under the starting directory, except that it doesn't look under any
3696-
CVS subdirectory::
3696+
``__pycache__`` subdirectory::
36973697

36983698
import os
36993699
from os.path import join, getsize
3700-
for root, dirs, files in os.walk('python/Lib/email'):
3700+
for root, dirs, files in os.walk('python/Lib/xml'):
37013701
print(root, "consumes", end=" ")
37023702
print(sum(getsize(join(root, name)) for name in files), end=" ")
37033703
print("bytes in", len(files), "non-directory files")
3704-
if 'CVS' in dirs:
3705-
dirs.remove('CVS') # don't visit CVS directories
3704+
if '__pycache__' in dirs:
3705+
dirs.remove('__pycache__') # don't visit __pycache__ directories
37063706

37073707
In the next example (simple implementation of :func:`shutil.rmtree`),
37083708
walking the tree bottom-up is essential, :func:`rmdir` doesn't allow
@@ -3755,16 +3755,16 @@ features:
37553755

37563756
This example displays the number of bytes taken by non-directory files in each
37573757
directory under the starting directory, except that it doesn't look under any
3758-
CVS subdirectory::
3758+
``__pycache__`` subdirectory::
37593759

37603760
import os
3761-
for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
3761+
for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):
37623762
print(root, "consumes", end="")
37633763
print(sum([os.stat(name, dir_fd=rootfd).st_size for name in files]),
37643764
end="")
37653765
print("bytes in", len(files), "non-directory files")
3766-
if 'CVS' in dirs:
3767-
dirs.remove('CVS') # don't visit CVS directories
3766+
if '__pycache__' in dirs:
3767+
dirs.remove('__pycache__') # don't visit __pycache__ directories
37683768

37693769
In the next example, walking the tree bottom-up is essential:
37703770
:func:`rmdir` doesn't allow deleting a directory before the directory is

Doc/library/socket.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ The following functions all create :ref:`socket objects <socket-objects>`.
882882
, a default reasonable value is chosen.
883883
*reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option.
884884

885-
If *dualstack_ipv6* is true and the platform supports it the socket will
886-
be able to accept both IPv4 and IPv6 connections, else it will raise
887-
:exc:`ValueError`. Most POSIX platforms and Windows are supposed to support
888-
this functionality.
885+
If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform
886+
supports it the socket will be able to accept both IPv4 and IPv6 connections,
887+
else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are
888+
supposed to support this functionality.
889889
When this functionality is enabled the address returned by
890890
:meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6
891891
address represented as an IPv4-mapped IPv6 address.

Doc/library/stdtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4780,7 +4780,7 @@ can be used interchangeably to index the same dictionary entry.
47804780
such as an empty list. To get distinct values, use a :ref:`dict
47814781
comprehension <dict>` instead.
47824782

4783-
.. method:: get(key, default=None)
4783+
.. method:: get(key, default=None, /)
47844784

47854785
Return the value for *key* if *key* is in the dictionary, else *default*.
47864786
If *default* is not given, it defaults to ``None``, so that this method
@@ -4822,7 +4822,7 @@ can be used interchangeably to index the same dictionary entry.
48224822

48234823
.. versionadded:: 3.8
48244824

4825-
.. method:: setdefault(key, default=None)
4825+
.. method:: setdefault(key, default=None, /)
48264826

48274827
If *key* is in the dictionary, return its value. If not, insert *key*
48284828
with a value of *default* and return *default*. *default* defaults to

Include/cpython/tupleobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
typedef struct {
66
PyObject_VAR_HEAD
7+
/* Cached hash. Initially set to -1. */
8+
Py_hash_t ob_hash;
79
/* ob_item contains space for 'ob_size' elements.
810
Items must normally not be NULL, except during construction when
911
the tuple is not yet visible outside the function that builds it. */

Include/internal/pycore_dict.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ extern int _PyDict_Pop_KnownHash(
150150
Py_hash_t hash,
151151
PyObject **result);
152152

153+
#ifdef Py_GIL_DISABLED
154+
PyAPI_FUNC(void) _PyDict_EnsureSharedOnRead(PyDictObject *mp);
155+
#endif
156+
153157
#define DKIX_EMPTY (-1)
154158
#define DKIX_DUMMY (-2) /* Used internally */
155159
#define DKIX_ERROR (-3)

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ struct _Py_global_strings {
283283
STRUCT_FOR_ID(aggregate_class)
284284
STRUCT_FOR_ID(alias)
285285
STRUCT_FOR_ID(align)
286+
STRUCT_FOR_ID(all)
286287
STRUCT_FOR_ID(allow_code)
288+
STRUCT_FOR_ID(any)
287289
STRUCT_FOR_ID(append)
288290
STRUCT_FOR_ID(arg)
289291
STRUCT_FOR_ID(argdefs)

Include/internal/pycore_interp_structs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99

1010
#include "pycore_ast_state.h" // struct ast_state
1111
#include "pycore_llist.h" // struct llist_node
12+
#include "pycore_opcode_utils.h" // NUM_COMMON_CONSTANTS
1213
#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
1314
#include "pycore_structs.h" // PyHamtObject
1415
#include "pycore_tstate.h" // _PyThreadStateImpl
@@ -912,6 +913,7 @@ struct _is {
912913
struct ast_state ast;
913914
struct types_state types;
914915
struct callable_cache callable_cache;
916+
PyObject *common_consts[NUM_COMMON_CONSTANTS];
915917
bool jit;
916918
struct _PyExecutorObject *executor_list_head;
917919
size_t trace_run_counter;

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ Known values:
272272
Python 3.14a6 3617 (Branch monitoring for async for loops)
273273
Python 3.14a6 3618 (Add oparg to END_ASYNC_FOR)
274274
Python 3.14a6 3619 (Renumber RESUME opcode from 149 to 128)
275+
Python 3.14a6 3620 (Optimize bytecode for all/any/tuple called on a genexp)
275276
276277
Python 3.15 will start with 3650
277278
@@ -284,7 +285,7 @@ PC/launcher.c must also be updated.
284285
285286
*/
286287

287-
#define PYC_MAGIC_NUMBER 3619
288+
#define PYC_MAGIC_NUMBER 3620
288289
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
289290
(little-endian) and then appending b'\r\n'. */
290291
#define PYC_MAGIC_NUMBER_TOKEN \

0 commit comments

Comments
 (0)