summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-07 21:33:51 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-07 21:33:51 (GMT)
commitf6b769b4646b310730938def5e37fba8a89b47af (patch)
tree388ed6a22b5a440b1e4cbc8b2229ccc78d3516a5 /Doc/library
parentf5e8af1bb7e375e86298ae7a4ee5b6c3e8a22db4 (diff)
downloadcpython-f6b769b4646b310730938def5e37fba8a89b47af.zip
cpython-f6b769b4646b310730938def5e37fba8a89b47af.tar.gz
cpython-f6b769b4646b310730938def5e37fba8a89b47af.tar.bz2
Documentation nits.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/collections.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index fb9b958..be6c67f 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -364,8 +364,8 @@ they add the ability to access fields by name instead of position index.
method which lists the tuple contents in a ``name=value`` format.
The *fieldnames* are a single string with each fieldname separated by whitespace
- and/or commas (for example 'x y' or 'x, y'). Alternatively, the *fieldnames*
- can be specified with a sequence of strings (such as ['x', 'y']).
+ and/or commas (for example 'x y' or 'x, y'). Alternatively, *fieldnames*
+ can be a sequence of strings (such as ['x', 'y']).
Any valid Python identifier may be used for a fieldname except for names
starting with an underscore. Valid identifiers consist of letters, digits,
@@ -482,7 +482,7 @@ three additional methods and one attribute.
.. attribute:: somenamedtuple._fields
- Tuple of strings listing the field names. This is useful for introspection
+ Tuple of strings listing the field names. Useful for introspection
and for creating new named tuple types from existing named tuples.
::
@@ -501,7 +501,7 @@ function::
>>> getattr(p, 'x')
11
-When casting a dictionary to a named tuple, use the double-star-operator [#]_::
+To cast a dictionary to a named tuple, use the double-star-operator [#]_::
>>> d = {'x': 11, 'y': 22}
>>> Point(**d)
@@ -526,7 +526,7 @@ a fixed-width print format::
Point: x= 1.286 y= 6.000 hypot= 6.136
Another use for subclassing is to replace performance critcal methods with
-faster versions that bypass error-checking and localize variable access::
+faster versions that bypass error-checking and that localize variable access::
>>> class Point(namedtuple('Point', 'x y')):
_make = classmethod(tuple.__new__)