Why tuple with one item is no tuple

James Stroud jstroud at mbi.ucla.edu
Thu Mar 17 01:07:47 CET 2005


On Wednesday 16 March 2005 07:22 am, Diez B. Roggisch wrote:
> As I said: show me which parentheses to use

I kind of like the comma as a tuple "parentheses"

,1,2,3,

replacing

(1,2,3)
or
1,2,3,
or
1,2,3
or (isn't this is getting out of hand?)
(1,2,3,)

Why not--except of course for backward compatability? Comma is not used for 
anything else in python as far as I know. This would be very unambiguous. 
Then, the purity would manifest itself the naked comma being an empty tuple. 
Think about the zen of:

   ,


James


-- 
James Stroud, Ph.D.
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095



More information about the Python-list mailing list