[Python-checkins] r67355 - python/trunk/Doc/library/collections.rst
georg.brandl
python-checkins at python.org
Sun Nov 23 20:17:25 CET 2008
Author: georg.brandl
Date: Sun Nov 23 20:17:25 2008
New Revision: 67355
Log:
#4392: fix parameter name.
Modified:
python/trunk/Doc/library/collections.rst
Modified: python/trunk/Doc/library/collections.rst
==============================================================================
--- python/trunk/Doc/library/collections.rst (original)
+++ python/trunk/Doc/library/collections.rst Sun Nov 23 20:17:25 2008
@@ -487,16 +487,16 @@
self-documenting code. They can be used wherever regular tuples are used, and
they add the ability to access fields by name instead of position index.
-.. function:: namedtuple(typename, fieldnames, [verbose])
+.. function:: namedtuple(typename, field_names, [verbose])
Returns a new tuple subclass named *typename*. The new subclass is used to
create tuple-like objects that have fields accessible by attribute lookup as
well as being indexable and iterable. Instances of the subclass also have a
- helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__`
+ helpful docstring (with typename and field_names) and a helpful :meth:`__repr__`
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, *fieldnames*
+ The *field_names* are a single string with each fieldname separated by whitespace
+ and/or commas, for example ``'x y'`` or ``'x, y'``. Alternatively, *field_names*
can be a sequence of strings such as ``['x', 'y']``.
Any valid Python identifier may be used for a fieldname except for names
More information about the Python-checkins
mailing list