summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2009-09-23 21:36:39 +0000
committerEzio Melotti <ezio.melotti@gmail.com>2009-09-23 21:36:39 +0000
commit905c3019d7d083ee19f3d58f60d81c72376d6442 (patch)
tree92f4cb57db6ba3a6ca0d443439a5ff5e5a2174f0
parent618f22f20ee47196b15c4b154d6d965a53dfd6c2 (diff)
downloadcpython-905c3019d7d083ee19f3d58f60d81c72376d6442.tar.gz
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 ce49a39a8b..67aa2f483f 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -37,11 +37,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``::
@@ -56,8 +57,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)
@@ -80,7 +81,7 @@ patterns.
>>> regex
'.*\\.txt$'
>>> reobj = re.compile(regex)
- >>> print reobj.match('foobar.txt')
+ >>> reobj.match('foobar.txt')
<_sre.SRE_Match object at 0x...>