Tuple Format?

Rainer Deyke root at rainerdeyke.com
Sat Sep 2 11:54:40 EDT 2000


"Gene C" <gchiaramonte at yahoo.com> wrote in message
news:6q7s5.19214$C42.784903 at newsread2.prod.itd.earthlink.net...
> 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.

a = ||||||||

Is a (the empty tuple binary_or the empty tuple) binary_or the empty tuple
(() | () | () in current notation)?

Or is it the tuple containing the tuple containing the tuple containing the
empty tuple (((((),),),) in current notation)?

Either way, can you read it?

Even ignoring binary or, what about this:

||-||||

Is this the empty tuple minus the tuple containing the empty tuple (()-((),)
in the old notation) or the tuple containing the tuple containing the
opposite of the empty tuple (((-(),),) in the old notation)?


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list