[Python-checkins] r75039 - python/trunk/Doc/library/fnmatch.rst
ezio.melotti
python-checkins at python.org
Wed Sep 23 23:36:39 CEST 2009
Author: ezio.melotti
Date: Wed Sep 23 23:36:39 2009
New Revision: 75039
Log:
improved phrasing, markup and example
Modified:
python/trunk/Doc/library/fnmatch.rst
Modified: python/trunk/Doc/library/fnmatch.rst
==============================================================================
--- python/trunk/Doc/library/fnmatch.rst (original)
+++ python/trunk/Doc/library/fnmatch.rst Wed Sep 23 23:36:39 2009
@@ -37,11 +37,12 @@
.. 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 @@
.. 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 @@
>>> regex
'.*\\.txt$'
>>> reobj = re.compile(regex)
- >>> print reobj.match('foobar.txt')
+ >>> reobj.match('foobar.txt')
<_sre.SRE_Match object at 0x...>
More information about the Python-checkins
mailing list