Website hosting and domain hosting service by Active-Venture.com
  

 Back to Index


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.

 

  

 

2002-2004 Active-Venture.com Website Hosting Service

 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://python.org/doc/

 

Active-Domain.com offers cheap domain registration, domain name transfer and domain search services   Cheap domain name - Cheap domain name registration service including free domain hosting services  

Domain registration : Buy domain name or register domain name from $5.95/year only