5.2.3 括号表达式 Parenthesized forms

A parenthesized form is an optional expression list enclosed in parentheses:

一个括号表达式是位于一对小括号内可选的表达式表.

parenth_form  ::=  "(" [expression_list] ")"
Download entire grammar as text.

A parenthesized expression list yields whatever that expression list yields: if the list contains at least one comma, it yields a tuple; otherwise, it yields the single expression that makes up the expression list.

表达式表生成什么类型的值括号表达式也就生成什么类型的值:如果表达式表中包括了至少一个逗号, 它就生成一个元组; 否则, 就生成那个组成表达式表的唯一的表达式.

An empty pair of parentheses yields an empty tuple object. Since tuples are immutable, the rules for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object).

一个空的表达式表会生成一个空的元组对象.因为元组是不可变的, 因此这里适用字符串所用的规则(即, 两个具有空的元组可能是同一个对象也可能是不同的对象).

Note that tuples are not formed by the parentheses, but rather by use of the comma operator. The exception is the empty tuple, for which parentheses are required -- allowing unparenthesized ``nothing'' in expressions would cause ambiguities and allow common typos to pass uncaught.

请注意元组不是依靠小括号成定义的, 而使用逗号. 其中空元组是个例外, 此时要求有小括号 -- 在表达式中允许没有小括号的"空"可能会引起歧义,并容易造成难以查觉的笔误.