summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/fnmatch.rst2
-rw-r--r--Lib/fnmatch.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst
index ce07d32..925f08e 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -75,7 +75,7 @@ patterns.
.. function:: filter(names, pattern)
- Return the subset of the list of *names* that match *pattern*. It is the same as
+ Construct a list from those elements of the iterable *names* that match *pattern*. It is the same as
``[n for n in names if fnmatch(n, pattern)]``, but implemented more efficiently.
diff --git a/Lib/fnmatch.py b/Lib/fnmatch.py
index 0eb1802..7c52c23 100644
--- a/Lib/fnmatch.py
+++ b/Lib/fnmatch.py
@@ -52,7 +52,7 @@ def _compile_pattern(pat):
return re.compile(res).match
def filter(names, pat):
- """Return the subset of the list NAMES that match PAT."""
+ """Construct a list from those elements of the iterable NAMES that match PAT."""
result = []
pat = os.path.normcase(pat)
match = _compile_pattern(pat)