https://github.com/python/cpython/commit/b3d01fc56d745d895d40e6c57f4bb8eee14c7047 commit: b3d01fc56d745d895d40e6c57f4bb8eee14c7047 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: terryjreedy <[email protected]> date: 2024-01-30T18:50:28Z summary:
[3.12] Clarify one-item tuple (GH-114745) (#114757) A 'single tuple' means 'one tuple, of whatever length. Remove the unneeded and slightly distracting parenthetical 'singleton' comment. (cherry picked from commit a1332a99cf1eb9b879d4b1f28761b096b5749a0d) Co-authored-by: Terry Jan Reedy <[email protected]> files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 9ce2589fb3281d..8f7c014a6a4a9d 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1883,8 +1883,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: ``()``.) _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
