diff options
author | Mariatta <Mariatta@users.noreply.github.com> | 2017-04-26 01:23:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 01:23:05 (GMT) |
commit | 16b6f971bd8afc72b439b83324eba744460adb67 (patch) | |
tree | 3858cc33e7747c6fcdc5cdde337aca2b09418900 /Doc/library | |
parent | ea0efa3bc1d0b832da75519c6f85d767ae44feda (diff) | |
download | cpython-16b6f971bd8afc72b439b83324eba744460adb67.zip cpython-16b6f971bd8afc72b439b83324eba744460adb67.tar.gz cpython-16b6f971bd8afc72b439b83324eba744460adb67.tar.bz2 |
[3.6] bpo-28851: Improve namedtuple documentation (GH-1274) (GH-1286)
Clarify that a sequence of strings is the preferred value for 'field_names'.
(cherry picked from commit 97bf722fcd1de1236824377e052369dc7686b644)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/collections.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 8e2eb4d..2d51f0c 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -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, |