Op 2005-03-16, Tim Roberts schreef <[EMAIL PROTECTED]>: > Gregor Horvath <[EMAIL PROTECTED]> wrote: >> >> >>>type(['1']) >><type 'list'> >> >> >>>type(('1')) >><type 'str'> >> >>I wonder why ('1') is no tuple???? > > There were lots of answers, but I'm not sure I saw the "why" addressed. > > Consider this: > > a = (3 + 5) * 5 > > You really, really want (3 + 5) to be an integer, not a one-item tuple.
I sometimes do wonder if some impliciteness wouldn't be better here, so that any item could be treated as if it was a one-item tuple. A bit like every char being a string. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list