Skip to content

Commit 31fd434

Browse files
authored
Merge branch 'main' into multi_inputs
2 parents 9d992cd + a42168d commit 31fd434

29 files changed

+663
-436
lines changed

Doc/c-api/arg.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Parsing arguments and building values
66
=====================================
77

8-
These functions are useful when creating your own extensions functions and
8+
These functions are useful when creating your own extension functions and
99
methods. Additional information and examples are available in
1010
:ref:`extending-index`.
1111

Doc/library/glob.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ The :mod:`glob` module defines the following functions:
7575
Using the "``**``" pattern in large directory trees may consume
7676
an inordinate amount of time.
7777

78+
.. note::
79+
This function may return duplicate path names if *pathname*
80+
contains multiple "``**``" patterns and *recursive* is true.
81+
7882
.. versionchanged:: 3.5
7983
Support for recursive globs using "``**``".
8084

@@ -84,11 +88,6 @@ The :mod:`glob` module defines the following functions:
8488
.. versionchanged:: 3.11
8589
Added the *include_hidden* parameter.
8690

87-
.. versionchanged:: 3.14
88-
Matching path names are returned only once. In previous versions, this
89-
function may return duplicate path names if *pathname* contains multiple
90-
"``**``" patterns and *recursive* is true.
91-
9291

9392
.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \
9493
include_hidden=False)
@@ -99,6 +98,10 @@ The :mod:`glob` module defines the following functions:
9998
.. audit-event:: glob.glob pathname,recursive glob.iglob
10099
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
101100

101+
.. note::
102+
This function may return duplicate path names if *pathname*
103+
contains multiple "``**``" patterns and *recursive* is true.
104+
102105
.. versionchanged:: 3.5
103106
Support for recursive globs using "``**``".
104107

@@ -108,11 +111,6 @@ The :mod:`glob` module defines the following functions:
108111
.. versionchanged:: 3.11
109112
Added the *include_hidden* parameter.
110113

111-
.. versionchanged:: 3.14
112-
Matching path names are yielded only once. In previous versions, this
113-
function may yield duplicate path names if *pathname* contains multiple
114-
"``**``" patterns and *recursive* is true.
115-
116114

117115
.. function:: escape(pathname)
118116

Doc/library/importlib.metadata.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ Distribution versions
268268

269269
.. function:: version(distribution_name)
270270

271-
Return the installed distribution package version for the named
272-
distribution package.
271+
Return the installed distribution package
272+
`version <https://packaging.python.org/en/latest/specifications/core-metadata/#version>`__
273+
for the named distribution package.
273274

274275
Raises :exc:`PackageNotFoundError` if the named distribution
275276
package is not installed in the current Python environment.

Doc/library/profile.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,32 @@ them in various ways.
123123

124124
.. _profile-cli:
125125

126+
.. program:: cProfile
127+
126128
The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script to
127129
profile another script. For example::
128130

129131
python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)
130132

131-
``-o`` writes the profile results to a file instead of to stdout
133+
.. option:: -o <output_file>
134+
135+
Writes the profile results to a file instead of to stdout.
136+
137+
.. option:: -s <sort_order>
138+
139+
Specifies one of the :func:`~pstats.Stats.sort_stats` sort values
140+
to sort the output by.
141+
This only applies when :option:`-o <cProfile -o>` is not supplied.
132142

133-
``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to sort
134-
the output by. This only applies when ``-o`` is not supplied.
143+
.. option:: -m <module>
135144

136-
``-m`` specifies that a module is being profiled instead of a script.
145+
Specifies that a module is being profiled instead of a script.
137146

138-
.. versionadded:: 3.7
139-
Added the ``-m`` option to :mod:`cProfile`.
147+
.. versionadded:: 3.7
148+
Added the ``-m`` option to :mod:`cProfile`.
140149

141-
.. versionadded:: 3.8
142-
Added the ``-m`` option to :mod:`profile`.
150+
.. versionadded:: 3.8
151+
Added the ``-m`` option to :mod:`profile`.
143152

144153
The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of methods
145154
for manipulating and printing the data saved into a profile results file::

Doc/library/traceback.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ the module-level functions described above.
508508
A :class:`!FrameSummary` object represents a single :ref:`frame <frame-objects>`
509509
in a :ref:`traceback <traceback-objects>`.
510510

511-
.. class:: FrameSummary(filename, lineno, name, lookup_line=True, locals=None, line=None)
511+
.. class:: FrameSummary(filename, lineno, name, *,\
512+
lookup_line=True, locals=None,\
513+
line=None, end_lineno=None, colno=None, end_colno=None)
512514

513515
Represents a single :ref:`frame <frame-objects>` in the
514516
:ref:`traceback <traceback-objects>` or stack that is being formatted
@@ -544,6 +546,22 @@ in a :ref:`traceback <traceback-objects>`.
544546
trailing whitespace stripped.
545547
If the source is not available, it is ``None``.
546548

549+
.. attribute:: FrameSummary.end_lineno
550+
551+
The last line number of the source code for this frame.
552+
By default, it is set to ``lineno`` and indexation starts from 1.
553+
554+
.. attribute:: FrameSummary.colno
555+
556+
The column number of the source code for this frame.
557+
By default, it is ``None`` and indexation starts from 0.
558+
559+
.. attribute:: FrameSummary.end_colno
560+
561+
The last column number of the source code for this frame.
562+
By default, it is ``None`` and indexation starts from 0.
563+
564+
547565
.. _traceback-example:
548566

549567
Examples of Using the Module-Level Functions

Doc/library/uuid.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
1414
and the functions :func:`uuid1`, :func:`uuid3`, :func:`uuid4`, :func:`uuid5`,
15-
and :func:`uuid.uuid8` for generating version 1, 3, 4, 5, and 8 UUIDs as
16-
specified in :rfc:`9562` (which supersedes :rfc:`4122`).
15+
:func:`uuid6`, and :func:`uuid8` for generating version 1, 3, 4, 5, 6,
16+
and 8 UUIDs as specified in :rfc:`9562` (which supersedes :rfc:`4122`).
1717

1818
If all you want is a unique ID, you should probably call :func:`uuid1` or
1919
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
@@ -153,8 +153,8 @@ which relays any information about the UUID's safety, using this enumeration:
153153
The UUID version number (1 through 8, meaningful only when the variant is
154154
:const:`RFC_4122`).
155155

156-
.. versionchanged:: 3.14
157-
Added UUID version 8.
156+
.. versionchanged:: next
157+
Added UUID versions 6 and 8.
158158

159159

160160
.. attribute:: UUID.is_safe
@@ -212,6 +212,22 @@ The :mod:`uuid` module defines the following functions:
212212
that will be encoded using UTF-8).
213213

214214

215+
.. function:: uuid6(node=None, clock_seq=None)
216+
217+
Generate a UUID from a sequence number and the current time according to
218+
:rfc:`9562`.
219+
This is an alternative to :func:`uuid1` to improve database locality.
220+
221+
When *node* is not specified, :func:`getnode` is used to obtain the hardware
222+
address as a 48-bit positive integer. When a sequence number *clock_seq* is
223+
not specified, a pseudo-random 14-bit positive integer is generated.
224+
225+
If *node* or *clock_seq* exceed their expected bit count, only their least
226+
significant bits are kept.
227+
228+
.. versionadded:: next
229+
230+
215231
.. function:: uuid8(a=None, b=None, c=None)
216232

217233
Generate a pseudo-random UUID according to
@@ -314,7 +330,7 @@ The :mod:`uuid` module can be executed as a script from the command line.
314330

315331
.. code-block:: sh
316332
317-
python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid8}] [-n NAMESPACE] [-N NAME]
333+
python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6,uuid8}] [-n NAMESPACE] [-N NAME]
318334
319335
The following options are accepted:
320336

@@ -330,8 +346,8 @@ The following options are accepted:
330346
Specify the function name to use to generate the uuid. By default :func:`uuid4`
331347
is used.
332348

333-
.. versionadded:: 3.14
334-
Allow generating UUID version 8.
349+
.. versionchanged:: next
350+
Allow generating UUID versions 6 and 8.
335351

336352
.. option:: -n <namespace>
337353
--namespace <namespace>

Doc/whatsnew/3.14.rst

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,8 @@ urllib
919919
uuid
920920
----
921921

922-
* Add support for UUID version 8 via :func:`uuid.uuid8` as specified
923-
in :rfc:`9562`.
922+
* Add support for UUID versions 6 and 8 via :func:`uuid.uuid6` and
923+
:func:`uuid.uuid8` respectively, as specified in :rfc:`9562`.
924924
(Contributed by Bénédikt Tran in :gh:`89083`.)
925925

926926
* :const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the
@@ -968,14 +968,6 @@ base64
968968
(Contributed by Bénédikt Tran, Chris Markiewicz, and Adam Turner in :gh:`118761`.)
969969

970970

971-
glob
972-
----
973-
974-
* Reduce the number of system calls in :func:`glob.glob` and :func:`~glob.iglob`,
975-
thereby improving the speed of globbing operations by 20-80%.
976-
(Contributed by Barney Gale in :gh:`116380`.)
977-
978-
979971
io
980972
---
981973
* :mod:`io` which provides the built-in :func:`open` makes less system calls

0 commit comments

Comments
 (0)