Tuple Format?
Delaney, Timothy
tdelaney at avaya.com
Sun Sep 3 20:07:59 EDT 2000
> >What about using the pipe to define tuples?
> >
> >Empty Tuple ||
> >1 Element Tuple |'a'|
> >3 Element Tuple |'a', 'b', 'c'|
>
> Same problem as with using < and >, it's aready a binary
> operator, so the syntax is a bit ambiguous. One thought would
> be to use the single quotes for tuple delimiters (as in `a,b,c'
> or `x' or `'). This has the advantage (in my mind) of reminding
> one that tuples are like strings: immutable.
Although it suffers from the problem of putting tuples inside tuples, I
think backquotes would be a good idea (I don't think they're used anywhere,
though I could be wrong).
`a, b, c` ... works pretty well, but then ``a, b, c`` is what?
Except for the fact that tuples are used everywhere, I would suggest a
two-character sequence (or perhaps an opening two-character sequence)
[` a, b, c ] or [` a, b, c `]
where the back-quote modifies the list to be immutable.
Something along these lines, in any case.
Tim Delaney
Programmer, Avaya.
More information about the Python-list
mailing list