expression_list |
::= | expression ( "," expression )* [","] |
An expression list containing at least one comma yields a tuple. The length of the tuple is the number of expressions in the list. The expressions are evaluated from left to right.
一个表达式表是一个包括至少一个逗号的元组, 它的长是表中表达式的个数.其中表达式从左到右按顺序计算.
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 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:
()
.)
最后的逗号仅仅在创建单元素元组(又称为"独元")时才需要; 在其它情况下, 它是可选的. 一个没有后缀逗号的表达式不会创建元组, 但仍会计算该表达式的值.(可以使用一对空括号() 创建一个空元组).