summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2009-09-23 21:44:27 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2009-09-23 21:44:27 (GMT)
commitceaebc3b585ddff8eae7473e7bcfbfbf0acade93 (patch)
treebb4df3b8e4eee3f6f2f75741fff29c1d9b5ec123
parent239db95c0cbed5bb6b2c402cb28cd0ab60fc3dbf (diff)
downloadcpython-ceaebc3b585ddff8eae7473e7bcfbfbf0acade93.zip
cpython-ceaebc3b585ddff8eae7473e7bcfbfbf0acade93.tar.gz
cpython-ceaebc3b585ddff8eae7473e7bcfbfbf0acade93.tar.bz2
Merged revisions 75041 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75041 | ezio.melotti | 2009-09-24 00:42:25 +0300 (Thu, 24 Sep 2009) | 9 lines Merged revisions 75039 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75039 | ezio.melotti | 2009-09-24 00:36:39 +0300 (Thu, 24 Sep 2009) | 1 line improved phrasing, markup and example ........ ................
-rw-r--r--Doc/library/fnmatch.rst17
1 files changed, 9 insertions, 8 deletions
diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst
index 7561880..7fa6148 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -36,11 +36,12 @@ patterns.
.. function:: fnmatch(filename, pattern)
- Test whether the *filename* string matches the *pattern* string, returning true
- or false. If the operating system is case-insensitive, then both parameters
- will be normalized to all lower- or upper-case before the comparison is
- performed. If you require a case-sensitive comparison regardless of whether
- that's standard for your operating system, use :func:`fnmatchcase` instead.
+ Test whether the *filename* string matches the *pattern* string, returning
+ :const:`True` or :const:`False`. If the operating system is case-insensitive,
+ then both parameters will be normalized to all lower- or upper-case before
+ the comparison is performed. :func:`fnmatchcase` can be used to perform a
+ case-sensitive comparison, regardless of whether that's standard for the
+ operating system.
This example will print all file names in the current directory with the
extension ``.txt``::
@@ -55,8 +56,8 @@ patterns.
.. function:: fnmatchcase(filename, pattern)
- Test whether *filename* matches *pattern*, returning true or false; the
- comparison is case-sensitive.
+ Test whether *filename* matches *pattern*, returning :const:`True` or
+ :const:`False`; the comparison is case-sensitive.
.. function:: filter(names, pattern)
@@ -77,7 +78,7 @@ patterns.
>>> regex
'.*\\.txt$'
>>> reobj = re.compile(regex)
- >>> print(reobj.match('foobar.txt'))
+ >>> reobj.match('foobar.txt')
<_sre.SRE_Match object at 0x...>