8000 Merge branch 'main' into gh-131998-method-descriptor-crash · ZeroIntensity/cpython@363acec · GitHub
[go: up one dir, main page]

Skip to content

Commit 363acec

Browse files
authored
Merge branch 'main' into pythongh-131998-method-descriptor-crash
2 parents d87de41 + ee36572 commit 363acec

Some content is hidden

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

50 files changed

+551
-307
lines changed

Doc/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,12 @@
631631
'line_color': '#3776ab',
632632
}
633633
ogp_custom_meta_tags = [
634-
'<meta name="theme-color" content="#3776ab" />',
634+
'<meta name="theme-color" content="#3776ab">',
635635
]
636636
if 'create-social-cards' not in tags: # noqa: F821
637637
# Define a static preview image when not creating social cards
638638
ogp_image = '_static/og-image.png'
639639
ogp_custom_meta_tags += [
640-
'<meta property="og:image:width" content="200" />',
641-
'<meta property="og:image:height" content="200" />',
640+
'<meta property="og:image:width" content="200">',
641+
'<meta property="og:image:height" content="200">',
642642
]

Doc/includes/email-alternative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
recette
3737
</a> sera sûrement un très bon repas.
3838
</p>
39-
<img src="cid:{asparagus_cid}" />
39+
<img src="cid:{asparagus_cid}">
4040
</body>
4141
</html>
4242
""".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')

Doc/library/concurrent.futures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ the bytes over a shared :mod:`socket <socket>` or
298298

299299
The optional *initializer* and *initargs* arguments have the same
300300
meaning as for :class:`!ThreadPoolExecutor`: the initializer is run
301-
when each worker is created, though in this case it is run.in
301+
when each worker is created, though in this case it is run in
302302
the worker's interpreter. The executor serializes the *initializer*
303303
and *initargs* using :mod:`pickle` when sending them to the worker's
304304
interpreter.

Doc/library/dataclasses.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Module contents
164164

165165
- *match_args*: If true (the default is ``True``), the
166166
:attr:`~object.__match_args__` tuple will be created from the list of
167-
parameters to the generated :meth:`~object.__init__` method (even if
167+
non keyword-only parameters to the generated :meth:`~object.__init__` method (even if
168168
:meth:`!__init__` is not generated, see above). If false, or if
169169
:attr:`!__match_args__` is already defined in the class, then
170170
:attr:`!__match_args__` will not be generated.
@@ -175,11 +175,12 @@ Module contents
175175
fields will be marked as keyword-only. If a field is marked as
176176
keyword-only, then the only effect is that the :meth:`~object.__init__`
177177
parameter generated from a keyword-only field must be specified
178-
with a keyword when :meth:`!__init__` is called. There is no
179-
effect on any other aspect of dataclasses. See the
180-
:term:`parameter` glossary entry for details. Also see the
178+
with a keyword when :meth:`!__init__` is called. See the :term:`parameter`
179+
glossary entry for details. Also see the
181180
:const:`KW_ONLY` section.
182181

182+
Keyword-only fields are not included in :attr:`!__match_args__`.
183+
183184
.. versionadded:: 3.10
184185

185186
- *slots*: If true (the default is ``False``), :attr:`~object.__slots__` attribute
@@ -299,6 +300,8 @@ Module contents
299300
This is used when the generated :meth:`~object.__init__` method's
300301
parameters are computed.
301302

303+
Keyword-only fields are also not included in :attr:`!__match_args__`.
304+
302305
.. versionadded:: 3.10
303306

304307
- ``doc``: optional docstring for this field.

Doc/library/json.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ Encoders and Decoders
486486
(to raise :exc:`TypeError`).
487487

488488
If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when
489-
trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`
490-
or ``None``. If *skipkeys* is true, such items are simply skipped.
489+
trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`,
490+
:class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped.
491491

492492
If *ensure_ascii* is true (the default), the output is guaranteed to
493493
have all incoming non-ASCII characters escaped. If *ensure_ascii* is

Doc/library/multiprocessing.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,13 @@ object -- see :ref:`multiprocessing-managers`.
14211421
when invoked on an unlocked lock, a :exc:`ValueError` is raised.
14221422

14231423

1424+
.. method:: locked()
1425+
1426+
Return a boolean indicating whether this object is locked right now.
1427+
1428+
.. versionadded:: next
1429+
1430+
14241431
.. class:: RLock()
14251432

14261433
A recursive lock object: a close analog of :class:`threading.RLock`. A
@@ -1481,6 +1488,13 @@ object -- see :ref:`multiprocessing-managers`.
14811488
differs from the implemented behavior in :meth:`threading.RLock.release`.
14821489

14831490

1491+
.. method:: locked()
1492+
1493+
Return a boolean indicating whether this object is locked right now.
1494+
1495+
.. versionadded:: next
1496+
1497+
14841498
.. class:: Semaphore([value])
14851499

14861500
A semaphore object: a close analog of :class:`threading.Semaphore`.

Doc/library/string.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,10 @@ Using the comma or the underscore as a digit group separator::
737737
'4996_02d2'
738738
>>> '{:_}'.format(123456789.123456789)
739739
'123_456_789.12345679'
740-
>>> '{:._}'.format(123456789.123456789)
741-
'123456789.123_456_79'
742-
>>> '{:_._}'.format(123456789.123456789)
743-
'123_456_789.123_456_79'
740+
>>> '{:.,}'.format(123456789.123456789)
741+
'123456789.123,456,79'
742+
>>> '{:,._}'.format(123456789.123456789)
743+
'123,456,789.123_456_79'
744744

745745
Expressing a percentage::
746746

Doc/library/threading.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,13 @@ call release as many times the lock has been acquired can lead to deadlock.
709709
There is no return value.
710710

711711

712+
.. method:: locked()
713+
714+
Return a boolean indicating whether this object is locked right now.
715+
716+
.. versionadded:: next
717+
718+
712719
.. _condition-objects:
713720

714721
Condition Objects
@@ -801,6 +808,12 @@ item to the buffer only needs to wake up one consumer thread.
801808
Release the underlying lock. This method calls the corresponding method on
802809
the underlying lock; there is no return value.
803810

811+
.. method:: locked()
812+
813+
Return a boolean indicating whether this object is locked right now.
814+
815+
.. versionadded:: next
816+
804817
.. method:: wait(timeout=None)
805818

806819
Wait until notified or until a timeout occurs. If the calling thread has

Doc/library/uuid.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ which relays any information about the UUID's safety, using this enumeration:
121121
- The last 48 bits of the UUID. Only relevant to version 1.
122122

123123
* - .. attribute:: UUID.time
124-
- The 60-bit timestamp for version 1 and 6,
125-
or the 48-bit timestamp for version 7.
124+
- The 60-bit timestamp as a count of 100-nanosecond intervals since
125+
Gregorian epoch (1582-10-15 00:00:00) for versions 1 and 6, or the
126+
48-bit timestamp in milliseconds since Unix epoch (1970-01-01 00:00:00)
127+
for version 7.
126128

127129
* - .. attribute:: UUID.clock_seq
128130
- The 14-bit sequence number. Only relevant to versions 1 and 6.
@@ -434,6 +436,15 @@ Here are some examples of typical usage of the :mod:`uuid` module::
434436
>>> uuid.MAX
435437
UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')
436438

439+
>>> # get UUIDv7 creation (local) time as a timestamp in milliseconds
440+
>>> u = uuid.uuid7()
441+
>>> u.time # doctest: +SKIP
442+
1743936859822
443+
>>> # get UUIDv7 creation (local) time as a datetime object
444+
>>> import datetime as dt
445+
>>> dt.datetime.fromtimestamp(u.time / 1000) # doctest: +SKIP
446+
datetime.datetime(...)
447+
437448

438449
.. _uuid-cli-example:
439450

Doc/tools/templates/download.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212
{% set dl_version = release %}
1313
{% endif %}
1414

15+
{%- block extrahead -%}
16+
{{ super() }}
17+
<meta property="og:title" content="Download — Python {{ dl_version }} documentation">
18+
<meta property="og:type" content="website">
19+
<meta property="og:url" content="https://docs.python.org/3/download.html">
20+
<meta property="og:site_name" content="Python documentation">
21+
<meta property="og:description" content="Download Python documentation.">
22+
<meta property="og:image" content="https://docs.python.org/3/_static/og-image.png">
23+
<meta name="description" content="Download Python documentation.">
24+
<meta property="og:image:width" content="200">
25+
<meta property="og:image:height" content="200">
26+
<meta name="theme-color" content="#3776ab">
27+
{%- endblock -%}
28+
1529
{% block body %}
1630
<h1>{% trans %}Download Python {{ dl_version }} Documentation{% endtrans %}</h1>
1731

0 commit comments

Comments
 (0)
0