Commit 97bf722f authored by csabella's avatar csabella Committed by Mariatta

bpo-28851: Improve namedtuple documentation (GH-1274)

Clarify that a sequence of strings is the preferred value for 'field_names'.
parent 3e2ad8ec
......@@ -771,9 +771,9 @@ they add the ability to access fields by name instead of position index.
helpful docstring (with typename and field_names) and a helpful :meth:`__repr__`
method which lists the tuple contents in a ``name=value`` format.
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']``.
The *field_names* are a sequence of strings such as ``['x', 'y']``.
Alternatively, *field_names* can be a single string with each fieldname
separated by whitespace and/or commas, for example ``'x y'`` or ``'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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment