From cfe808a4d144082f98bb45623a86ac3a42f543ba Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 30 Jan 2024 01:21:04 -0500 Subject: [PATCH 1/2] Clarify one-item tuple. A 'single tuple' means 'one typle, of whatever length. --- Doc/reference/expressions.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 87ebdc1ca1c9c6..7ae43203781820 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -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 (a.k.a. a +*singleton*), 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: ``()``.) From 596bede54071ad29dffea716ef24c2dab82cd0e7 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 30 Jan 2024 13:34:35 -0500 Subject: [PATCH 2/2] Removed parenthetical 'singleton' comment --- Doc/reference/expressions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 7ae43203781820..50e0f97a6534af 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1890,8 +1890,8 @@ the unpacking. .. index:: pair: trailing; comma -A trailing comma is required only to create a one-item tuple (a.k.a. a -*singleton*), such as ``1,``; it is optional in all other cases. +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: