Skip to content

Commit 0cb2d8b

Browse files
committed
Merge main to work around BPO-45220 unrelated Windows failures
2 parents e30c9d8 + 778b075 commit 0cb2d8b

250 files changed

Lines changed: 36403 additions & 41658 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Objects/clinic/*.h linguist-generated=true
4747
PC/clinic/*.h linguist-generated=true
4848
Python/clinic/*.h linguist-generated=true
4949
Python/frozen_modules/*.h linguist-generated=true
50+
Python/frozen_modules/MANIFEST linguist-generated=true
5051
Include/internal/pycore_ast.h linguist-generated=true
5152
Python/Python-ast.c linguist-generated=true
5253
Include/opcode.h linguist-generated=true

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ Tools/msi/obj
121121
Tools/ssl/amd64
122122
Tools/ssl/win32
123123

124+
# The frozen modules are always generated by the build so we don't
125+
# keep them in the repo. Also see Tools/scripts/freeze_modules.py.
126+
Python/frozen_modules/*.h
127+
# The manifest can be generated at any time with "make regen-frozen".
128+
Python/frozen_modules/MANIFEST
129+
124130
# Two-trick pony for OSX and other case insensitive file systems:
125131
# Ignore ./python binary on Unix but still look into ./Python/ directory.
126132
/python

Doc/c-api/intro.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ complete listing.
111111

112112
.. versionadded:: 3.3
113113

114+
.. c:macro:: Py_ALWAYS_INLINE
115+
116+
Ask the compiler to always inline a static inline function. The compiler can
117+
ignore it and decides to not inline the function.
118+
119+
It can be used to inline performance critical static inline functions when
120+
building Python in debug mode with function inlining disabled. For example,
121+
MSC disables function inlining when building in debug mode.
122+
123+
Marking blindly a static inline function with Py_ALWAYS_INLINE can result in
124+
worse performances (due to increased code size for example). The compiler is
125+
usually smarter than the developer for the cost/benefit analysis.
126+
127+
It must be specified before the function return type. Usage::
128+
129+
static inline Py_ALWAYS_INLINE int random(void) { return 4; }
130+
131+
.. versionadded:: 3.11
132+
114133
.. c:macro:: Py_CHARMASK(c)
115134
116135
Argument must be a character or an integer in the range [-128, 127] or [0,

Doc/c-api/typeobj.rst

Lines changed: 132 additions & 132 deletions
Large diffs are not rendered by default.

Doc/library/calendar.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,13 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
279279

280280
This subclass of :class:`TextCalendar` can be passed a locale name in the
281281
constructor and will return month and weekday names in the specified locale.
282-
If this locale includes an encoding all strings containing month and weekday
283-
names will be returned as unicode.
284282

285283

286284
.. class:: LocaleHTMLCalendar(firstweekday=0, locale=None)
287285

288286
This subclass of :class:`HTMLCalendar` can be passed a locale name in the
289287
constructor and will return month and weekday names in the specified
290-
locale. If this locale includes an encoding all strings containing month and
291-
weekday names will be returned as unicode.
288+
locale.
292289

293290
.. note::
294291

Doc/library/configparser.rst

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ A configuration file consists of sections, each led by a ``[section]`` header,
261261
followed by key/value entries separated by a specific string (``=`` or ``:`` by
262262
default [1]_). By default, section names are case sensitive but keys are not
263263
[1]_. Leading and trailing whitespace is removed from keys and values.
264-
Values can be omitted, in which case the key/value delimiter may also be left
264+
Values can be omitted if the parser is configured to allow it [1]_,
265+
in which case the key/value delimiter may also be left
265266
out. Values can also span multiple lines, as long as they are indented deeper
266267
than the first line of the value. Depending on the parser's mode, blank lines
267268
may be treated as parts of multiline values or ignored.
@@ -1200,28 +1201,6 @@ ConfigParser Objects
12001201
names is stripped before :meth:`optionxform` is called.
12011202

12021203

1203-
.. method:: readfp(fp, filename=None)
1204-
1205-
.. deprecated:: 3.2
1206-
Use :meth:`read_file` instead.
1207-
1208-
.. versionchanged:: 3.2
1209-
:meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``.
1210-
1211-
For existing code calling :meth:`readfp` with arguments which don't
1212-
support iteration, the following generator may be used as a wrapper
1213-
around the file-like object::
1214-
1215-
def readline_generator(fp):
1216-
line = fp.readline()
1217-
while line:
1218-
yield line
1219-
line = fp.readline()
1220-
1221-
Instead of ``parser.readfp(fp)`` use
1222-
``parser.read_file(readline_generator(fp))``.
1223-
1224-
12251204
.. data:: MAX_INTERPOLATION_DEPTH
12261205

12271206
The maximum depth for recursive interpolation for :meth:`get` when the *raw*
@@ -1359,6 +1338,9 @@ Exceptions
13591338
The ``filename`` attribute and :meth:`__init__` argument were renamed to
13601339
``source`` for consistency.
13611340

1341+
.. versionchanged:: 3.11
1342+
The deprecated ``filename`` attribute was removed.
1343+
13621344

13631345
.. rubric:: Footnotes
13641346

Doc/library/datetime.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,8 @@ incomplete or ambiguous ISO 8601 directives will raise a :exc:`ValueError`.
24312431
The full set of format codes supported varies across platforms, because Python
24322432
calls the platform C library's :func:`strftime` function, and platform
24332433
variations are common. To see the full set of format codes supported on your
2434-
platform, consult the :manpage:`strftime(3)` documentation.
2434+
platform, consult the :manpage:`strftime(3)` documentation. There are also
2435+
differences between platforms in handling of unsupported format specifiers.
24352436

24362437
.. versionadded:: 3.6
24372438
``%G``, ``%u`` and ``%V`` were added.

Doc/library/dbm.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ the Oracle Berkeley DB.
3333
file's format can't be guessed; or a string containing the required module
3434
name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``.
3535

36+
.. versionchanged:: 3.11
37+
Accepts :term:`path-like object` for filename.
3638

3739
.. function:: open(file, flag='r', mode=0o666)
3840

@@ -77,6 +79,9 @@ available, as well as :meth:`get` and :meth:`setdefault`.
7779
Deleting a key from a read-only database raises database module specific error
7880
instead of :exc:`KeyError`.
7981

82+
.. versionchanged:: 3.11
83+
Accepts :term:`path-like object` for file.
84+
8085
Key and values are always stored as bytes. This means that when
8186
strings are used they are implicitly converted to the default encoding before
8287
being stored.
@@ -202,6 +207,9 @@ supported.
202207
In addition to the dictionary-like methods, ``gdbm`` objects have the
203208
following methods:
204209

210+
.. versionchanged:: 3.11
211+
Accepts :term:`path-like object` for filename.
212+
205213
.. method:: gdbm.firstkey()
206214

207215
It's possible to loop over every key in the database using this method and the
@@ -298,6 +306,9 @@ to locate the appropriate header file to simplify building this module.
298306
In addition to the dictionary-like methods, ``ndbm`` objects
299307
provide the following method:
300308

309+
.. versionchanged:: 3.11
310+
Accepts :term:`path-like object` for filename.
311+
301312
.. method:: ndbm.close()
302313

303314
Close the ``ndbm`` database.
@@ -379,6 +390,9 @@ The module defines the following:
379390
flags ``'r'`` and ``'w'`` no longer creates a database if it does not
380391
exist.
381392

393+
.. versionchanged:: 3.11
394+
Accepts :term:`path-like object` for filename.
395+
382396
In addition to the methods provided by the
383397
:class:`collections.abc.MutableMapping` class, :class:`dumbdbm` objects
384398
provide the following methods:

Doc/library/dis.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,13 @@ details of bytecode instructions as :class:`Instruction` instances:
293293

294294
.. data:: argval
295295

296-
resolved arg value (if known), otherwise same as arg
296+
resolved arg value (if any), otherwise ``None``
297297

298298

299299
.. data:: argrepr
300300

301-
human readable description of operation argument
301+
human readable description of operation argument (if any),
302+
otherwise an empty string.
302303

303304

304305
.. data:: offset

Doc/library/itertools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,14 @@ which incur interpreter overhead.
821821
822822
def triplewise(iterable):
823823
"Return overlapping triplets from an iterable"
824-
# pairwise('ABCDEFG') -> ABC BCD CDE DEF EFG
824+
# triplewise('ABCDEFG') -> ABC BCD CDE DEF EFG
825825
for (a, _), (b, c) in pairwise(pairwise(iterable)):
826826
yield a, b, c
827827

828828
def sliding_window(iterable, n):
829829
# sliding_window('ABCDEFG', 4) -> ABCD BCDE CDEF DEFG
830830
it = iter(iterable)
831-
window = deque(islice(it, n), maxlen=n)
831+
window = collections.deque(islice(it, n), maxlen=n)
832832
if len(window) == n:
833833
yield tuple(window)
834834
for x in it:

0 commit comments

Comments
 (0)