Skip to content

Commit 4170796

Browse files
authored
Merge branch 'main' into multi_inputs
2 parents 1f4e5ac + 75f38af commit 4170796

33 files changed

+1056
-2047
lines changed

Doc/library/glob.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ 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-
8278
.. versionchanged:: 3.5
8379
Support for recursive globs using "``**``".
8480

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

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+
9192

9293
.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \
9394
include_hidden=False)
@@ -98,10 +99,6 @@ The :mod:`glob` module defines the following functions:
9899
.. audit-event:: glob.glob pathname,recursive glob.iglob
99100
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
100101

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

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

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+
114116

115117
.. function:: escape(pathname)
116118

Doc/library/pathlib.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,7 @@ Creating files and directories
15711571
Copying, moving and deleting
15721572
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15731573

1574-
.. method:: Path.copy(target, *, follow_symlinks=True, dirs_exist_ok=False, \
1575-
preserve_metadata=False)
1574+
.. method:: Path.copy(target, *, follow_symlinks=True, preserve_metadata=False)
15761575

15771576
Copy this file or directory tree to the given *target*, and return a new
15781577
:class:`!Path` instance pointing to *target*.
@@ -1582,12 +1581,6 @@ Copying, moving and deleting
15821581
default), the symlink's target is copied. Otherwise, the symlink is
15831582
recreated at the destination.
15841583

1585-
If the source is a directory and *dirs_exist_ok* is false (the default), a
1586-
:exc:`FileExistsError` is raised if the target is an existing directory.
1587-
If *dirs_exists_ok* is true, the copying operation will overwrite
1588-
existing files within the destination tree with corresponding files
1589-
from the source tree.
1590-
15911584
If *preserve_metadata* is false (the default), only directory structures
15921585
and file data are guaranteed to be copied. Set *preserve_metadata* to true
15931586
to ensure that file and directory permissions, flags, last access and
@@ -1604,7 +1597,7 @@ Copying, moving and deleting
16041597

16051598

16061599
.. method:: Path.copy_into(target_dir, *, follow_symlinks=True, \
1607-
dirs_exist_ok=False, preserve_metadata=False)
1600+
preserve_metadata=False)
16081601

16091602
Copy this file or directory tree into the given *target_dir*, which should
16101603
be an existing directory. Other arguments are handled identically to

Doc/whatsnew/3.14.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,14 @@ 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+
971979
io
972980
---
973981
* :mod:`io` which provides the built-in :func:`open` makes less system calls

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)