List vs. Tuple

Greg Ewing greg.ewing at compaq.com
Fri Oct 8 07:31:14 EDT 1999


Charles G Waldman wrote:
> 
> Parentheses
> are (unfortunately, IMO) overloaded, being both tuple-delimiters and
> the standard grouping operator

That statement is somewhat misleading -- parentheses actually
have NOTHING to do with tuple creation. You can do

  t1 = 1, 2, 3
  t2 = 4,

and get tuples. It's the commas, not the parentheses, which
make a tuple constructor. Keep that in mind and you won't get
confused as much.

You'll-still-get-confused-just-for-different-reasons,
Greg




More information about the Python-list mailing list