mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Clarify one-item tuple (#114745)
A 'single tuple' means 'one typle, of whatever length. Remove the unneeded and slight distracting parenthetical 'singleton' comment.
This commit is contained in:
parent
0990d55725
commit
a1332a99cf
@ -1890,8 +1890,9 @@ the unpacking.
|
||||
|
||||
.. index:: pair: trailing; comma
|
||||
|
||||
The trailing comma is required only to create a single tuple (a.k.a. a
|
||||
*singleton*); it is optional in all other cases. A single expression without a
|
||||
A trailing comma is required only to create a one-item tuple,
|
||||
such as ``1,``; it is optional in all other cases.
|
||||
A single expression without a
|
||||
trailing comma doesn't create a tuple, but rather yields the value of that
|
||||
expression. (To create an empty tuple, use an empty pair of parentheses:
|
||||
``()``.)
|
||||
|
Loading…
Reference in New Issue
Block a user