Skip to content

Commit 27643ef

Browse files
Merge branch '3.15' into backport-50fcb91-3.15
2 parents da24ef3 + eb796c5 commit 27643ef

38 files changed

Lines changed: 2400 additions & 1469 deletions

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ Include/internal/pycore_ast_state.h generated
8080
Include/internal/pycore_opcode.h generated
8181
Include/internal/pycore_opcode_metadata.h generated
8282
Include/internal/pycore_*_generated.h generated
83+
Include/internal/pycore_token.h generated
8384
Include/internal/pycore_uop_ids.h generated
8485
Include/internal/pycore_uop_metadata.h generated
8586
Include/opcode.h generated
8687
Include/opcode_ids.h generated
8788
Include/slots_generated.h generated
88-
Include/token.h generated
8989
Lib/_opcode_metadata.py generated
9090
Lib/idlelib/help.html generated
9191
Lib/keyword.py generated

Doc/library/annotationlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ Functions
235235
annotate functions that support the :attr:`~Format.STRING` format but
236236
do not have access to the code creating the annotations.
237237

238-
For example, this is used to implement the :attr:`~Format.STRING` for
239-
:class:`typing.TypedDict` classes created through the functional syntax:
238+
For example, this is used to implement the :attr:`~Format.STRING` format
239+
for :class:`typing.TypedDict` classes created through the functional syntax:
240240

241241
.. doctest::
242242

Doc/library/dataclasses.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ Module contents
262262
c = C()
263263
c.mylist += [1, 2, 3]
264264

265-
As shown above, the :const:`MISSING` value is a sentinel object used to
266-
detect if some parameters are provided by the user. This sentinel is
265+
As shown above, the :const:`MISSING` value is a :class:`sentinel` object
266+
used to detect if some parameters are provided by the user. This sentinel is
267267
used because ``None`` is a valid value for some parameters with
268268
a distinct meaning. No code should directly use the :const:`MISSING` value.
269269

@@ -523,11 +523,14 @@ Module contents
523523

524524
.. data:: MISSING
525525

526-
A sentinel value signifying a missing default or default_factory.
526+
A :class:`sentinel` object signifying a missing default or *default_factory*.
527+
528+
.. versionchanged:: 3.15
529+
:const:`!MISSING` is now a :class:`sentinel` object.
527530

528531
.. data:: KW_ONLY
529532

530-
A sentinel value used as a type annotation. Any fields after a
533+
A :class:`sentinel` object used as a type annotation. Any fields after a
531534
pseudo-field with the type of :const:`!KW_ONLY` are marked as
532535
keyword-only fields. Note that a pseudo-field of type
533536
:const:`!KW_ONLY` is otherwise completely ignored. This includes the
@@ -552,6 +555,9 @@ Module contents
552555

553556
.. versionadded:: 3.10
554557

558+
.. versionchanged:: 3.15
559+
:const:`!KW_ONLY` is now a :class:`sentinel` object.
560+
555561
.. exception:: FrozenInstanceError
556562

557563
Raised when an implicitly defined :meth:`~object.__setattr__` or

Doc/library/stdtypes.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ A hexadecimal string takes the form::
706706

707707
[sign] ['0x'] integer ['.' fraction] ['p' exponent]
708708

709-
where the optional ``sign`` may by either ``+`` or ``-``, ``integer``
709+
where the optional ``sign`` may be either ``+`` or ``-``, ``integer``
710710
and ``fraction`` are strings of hexadecimal digits, and ``exponent``
711711
is a decimal integer with an optional leading sign. Case is not
712712
significant, and there must be at least one hexadecimal digit in
@@ -1345,7 +1345,7 @@ Mutable sequence types also support the following methods:
13451345
:no-typesetting:
13461346
.. method:: sequence.pop(index=-1, /)
13471347

1348-
Retrieve the item at *index* and also removes it from *sequence*.
1348+
Retrieve the item at *index* and also remove it from *sequence*.
13491349
By default, the last item in *sequence* is removed and returned.
13501350

13511351
.. method:: bytearray.remove(value, /)
@@ -2120,7 +2120,7 @@ expression support in the :mod:`re` module).
21202120
one character, ``False`` otherwise. Alphabetic characters are those characters defined
21212121
in the Unicode character database as "Letter", i.e., those with general category
21222122
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
2123-
from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and
2123+
from the `Alphabetic property defined in section 4.10 'Letters, Alphabetic, and
21242124
Ideographic' of the Unicode Standard
21252125
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-4/#G91002>`__.
21262126
For example:
@@ -3042,7 +3042,7 @@ replacement field. For example::
30423042
'0.333333'
30433043
>>> f'{one_third:_^+10}'
30443044
'___+1/3___'
3045-
>>> >>> f'{one_third!r:_^20}'
3045+
>>> f'{one_third!r:_^20}'
30463046
'___Fraction(1, 3)___'
30473047
>>> f'{one_third = :~>10}~'
30483048
'one_third = ~~~~~~~1/3~'
@@ -3052,12 +3052,12 @@ replacement field. For example::
30523052
Template String Literals (t-strings)
30533053
------------------------------------
30543054

3055-
An :dfn:`t-string` (formally a :dfn:`template string literal`) is
3055+
A :dfn:`t-string` (formally a :dfn:`template string literal`) is
30563056
a string literal that is prefixed with ``t`` or ``T``.
30573057

30583058
These strings follow the same syntax and evaluation rules as
30593059
:ref:`formatted string literals <stdtypes-fstrings>`,
3060-
with for the following differences:
3060+
with the following differences:
30613061

30623062
* Rather than evaluating to a ``str`` object, template string literals evaluate
30633063
to a :class:`string.templatelib.Template` object.
@@ -3084,7 +3084,7 @@ with for the following differences:
30843084
The :class:`!Interpolation` instance for the expression will be created as
30853085
normal, except that :attr:`~string.templatelib.Interpolation.conversion` will
30863086
be set to '``r``' (:func:`repr`) by default.
3087-
If an explicit conversion or format specifier are provided,
3087+
If an explicit conversion or format specifier is provided,
30883088
this will override the default behaviour.
30893089

30903090

@@ -3461,7 +3461,7 @@ objects.
34613461

34623462
.. classmethod:: fromhex(string, /)
34633463

3464-
This :class:`bytearray` class method returns bytearray object, decoding
3464+
This :class:`bytearray` class method returns a bytearray object, decoding
34653465
the given string object. The string must contain two hexadecimal digits
34663466
per byte, with ASCII whitespace being ignored.
34673467

@@ -4420,7 +4420,7 @@ the ``%`` operator (modulo).
44204420
This is also known as the bytes *formatting* or *interpolation* operator.
44214421
Given ``format % values`` (where *format* is a bytes object), ``%`` conversion
44224422
specifications in *format* are replaced with zero or more elements of *values*.
4423-
The effect is similar to using the :c:func:`sprintf` in the C language.
4423+
The effect is similar to using the :c:func:`sprintf` function in the C language.
44244424

44254425
If *format* requires a single argument, *values* may be a single non-tuple
44264426
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
@@ -4621,7 +4621,7 @@ copying.
46214621
underlying data.
46224622

46234623
``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which
4624-
is the nested list representation of the view. If ``view.ndim = 1``,
4624+
is the nested list representation of the view. If ``view.ndim == 1``,
46254625
this is equal to the number of elements in the view.
46264626

46274627
.. versionchanged:: 3.12
@@ -4706,7 +4706,7 @@ copying.
47064706
:class:`collections.abc.Sequence`
47074707

47084708
.. versionchanged:: 3.5
4709-
memoryviews can now be indexed with tuple of integers.
4709+
memoryviews can now be indexed with a tuple of integers.
47104710

47114711
.. versionchanged:: 3.14
47124712
memoryview is now a :term:`generic type`.
@@ -6152,7 +6152,7 @@ enables cleaner type hinting syntax compared to subscripting :class:`typing.Unio
61526152

61536153
.. note::
61546154

6155-
The ``|`` operand cannot be used at runtime to define unions where one or
6155+
The ``|`` operator cannot be used at runtime to define unions where one or
61566156
more members is a forward reference. For example, ``int | "Foo"``, where
61576157
``"Foo"`` is a reference to a class not yet defined, will fail at
61586158
runtime. For unions which include forward references, present the
@@ -6311,7 +6311,7 @@ Methods
63116311
Methods are functions that are called using the attribute notation.
63126312
There are two flavors: :ref:`built-in methods <builtin-methods>`
63136313
(such as :meth:`~list.append` on lists)
6314-
and :ref:`class instance method <instance-methods>`.
6314+
and :ref:`class instance methods <instance-methods>`.
63156315
Built-in methods are described with the types that support them.
63166316

63176317
If you access a method (a function defined in a class namespace) through an

Doc/library/urllib.request.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,14 @@ These methods are available on :class:`HTTPPasswordMgr` and
987987

988988
*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and
989989
*passwd* must be strings. This causes ``(user, passwd)`` to be used as
990-
authentication tokens when authentication for *realm* and a super-URI of any of
991-
the given URIs is given.
990+
authentication tokens when authentication for *realm* and a super-URI of any
991+
of the given URIs is given. If a URI includes a scheme, its credentials only
992+
match authentication URIs with the same scheme or no scheme. A URI without a
993+
scheme matches authentication URIs with any scheme.
994+
995+
.. versionchanged:: next
996+
Authentication credentials for URIs with a scheme are now scoped by
997+
that scheme.
992998

993999

9941000
.. method:: HTTPPasswordMgr.find_user_password(realm, authuri)

Lib/calendar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
609609
content = self.formatyear(theyear, width)
610610
return self._format_html_page(theyear, content, css, encoding)
611611

612-
def formatmonthpage(self, theyear, themonth, width=3, css='calendar.css', encoding=None):
612+
def formatmonthpage(self, theyear, themonth, *, css='calendar.css', encoding=None):
613613
"""
614614
Return a formatted month as a complete HTML page.
615615
"""
616-
content = self.formatmonth(theyear, themonth, width)
616+
content = self.formatmonth(theyear, themonth)
617617
return self._format_html_page(theyear, content, css, encoding)
618618

619619

Lib/dbm/dumb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ def reorganize(self):
311311
reorganize_pos += blocks_occupied * _BLOCKSIZE
312312

313313
f.truncate(reorganize_pos)
314+
self._modified = True
314315
# Commit changes to index, which were not in-place.
315316
self._commit()
316317

0 commit comments

Comments
 (0)