List vs. Tuple

Aahz Maruch aahz at netcom.com
Fri Oct 8 10:17:09 EDT 1999


In article <000401bf1177$3d7d3760$3acbd9c2 at peridot.optichrome.com>,
Adrian Eyre <a.eyre at optichrome.com> wrote:
>> It's the commas, not the parentheses, which make a tuple
>> constructor.
>
>If this is the case, I wonder why the parentheses are present
>on the default repr() of a tuple?

Because __repr__ is supposed to be a cut'n'paste representation such
that dropping it into code will work.  There are many places in Python
where you need the parentheses to disambiguate the tuple creation.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>      http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6  (if you want to know, do some research)




More information about the Python-list mailing list