Tuple Format?

Gene C gchiaramonte at yahoo.com
Mon Sep 4 16:10:49 CEST 2000

> This makes parsing the two-character one interesting ... we can actually
> up with the equivalent of a single-element list which is the result of the
> repr().
> [` a, b, c `] == [ repr(a, b, c) ]

I do like the concept of adding a modifier to a list to show it is not
modifiable, ie a tuple. What about adding the backquote to the beginning of
the list?

`[] == ()
'[1] == (1,)
`[1, 2, 3] = (1, 2, 3)

Now we have some consistency.

Since a one character string is not written as "a," and a one element list
does not have to be written as [1,] although it can be, I do not believe
this discussion to be moot. If you want to see the evil of keeping oddities
check out c++ or perl. :-)


ps - Hey Guido, what do you think about all this?

More information about the Python-list mailing list