Tuple Format?

Gene C gchiaramonte at yahoo.com
Sat Sep 2 09:39:14 EDT 2000


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.

Gene

"Cliff Crawford" <cjc26 at nospam.cornell.edu> wrote in message
news:slrn8qvb36.222j.cjc26 at synecdoche.sowrong.org...
> * Gene C <gchiaramonte at yahoo.com> menulis:
> | Has anyone considered a different format for tuples to get around the
> | somewhat strange single element tuple format? I find when explaining the
> | language to others, the single tuple format always solicits a, "Thats
> | weird."
> |
> | For example, instead of (x,) how about <x>
> | and (a, b, c) would be <a, b, c>
>
> Good idea, but it would be hard to parse..for example:
>
> # tuple of booleans
>
> < a==b, c>d, e!=f >
>
>
> --
> http://www.people.cornell.edu/pages/cjc26/     "This is what his
platitudes
> amount to, although, of course, they're daubed over with the viscid
slobber
> of  demented drivel  devised by his  henchmen and mindlessly  multiplied
by
> treasonous heartless pissants.  And that, in my view, is our real
problem."
>





More information about the Python-list mailing list