Skip to content

Commit 5dffd79

Browse files
Clarify rx parameter of compileall functions (GH-25857)
(cherry picked from commit 0949029) Co-authored-by: Jean-Abou-Samra <[email protected]>
1 parent af14e1d commit 5dffd79

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/library/compileall.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ Public functions
166166
If *force* is true, modules are re-compiled even if the timestamps are up to
167167
date.
168168

169-
If *rx* is given, its search method is called on the complete path to each
169+
If *rx* is given, its ``search`` method is called on the complete path to each
170170
file considered for compilation, and if it returns a true value, the file
171-
is skipped.
171+
is skipped. This can be used to exclude files matching a regular expression,
172+
given as a :ref:`re.Pattern <re-objects>` object.
172173

173174
If *quiet* is ``False`` or ``0`` (the default), the filenames and other
174175
information are printed to standard out. Set to ``1``, only errors are
@@ -242,9 +243,10 @@ Public functions
242243
cases where the source file does not exist at the time the byte-code file is
243244
executed.
244245

245-
If *rx* is given, its search method is passed the full path name to the
246+
If *rx* is given, its ``search`` method is passed the full path name to the
246247
file being compiled, and if it returns a true value, the file is not
247-
compiled and ``True`` is returned.
248+
compiled and ``True`` is returned. This can be used to exclude files matching
249+
a regular expression, given as a :ref:`re.Pattern <re-objects>` object.
248250

249251
If *quiet* is ``False`` or ``0`` (the default), the filenames and other
250252
information are printed to standard out. Set to ``1``, only errors are

0 commit comments

Comments
 (0)