Tuple Format?

John W. Baxter jwbnews at scandaroon.com
Sat Sep 2 17:34:59 CEST 2000


In article <6q7s5.19214$C42.784903 at newsread2.prod.itd.earthlink.net>, 
"Gene C" <gchiaramonte at yahoo.com> wrote:

> Right, it was just a suggestion. I still think the list [] and dictionary 
> {}
> formats are quite elegant. I only wish the tuple could be implemented in 
> a
> similar manner. (Keeping the current format so tuples in the current 
> format
> is not broken.)
> 
> What about using the pipe to define tuples?
> 
> Empty Tuple ||
> 1 Element Tuple |'a'|
> 3 Element Tuple |'a', 'b', 'c'|
> 
> That looks nice to me and now we have no special cases and I don't think
> this clashes with anything in the language.

With | .... | one has similar opportunities to confuse the compiler and 
get strange error messages as with ' or " by leaving one off, or having 
one too many.

It's really nicer to have character pairs to work with.

   --John

-- 
John W. Baxter   Port Ludlow, WA USA  jwbnews at scandaroon.com



More information about the Python-list mailing list