On Wed, 14 Dec 2005 09:54:31 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") > >>> len(tuple) >4 > >>> tuple2 = ("blah",) > >>> len (tuple2) >1 > >So why is a tuple containing the string "blah" without the comma of >length four? Is there a good reason for this or is this a bug?
It's not a tuple :) >>> t = ("blah") >>> type(t) <type 'str'> >>> t2 = ("blah",) >>> type(t2) <type 'tuple'> >>> t3 = "blah", >>> type(t3) <type 'tuple'> >>> It's the comma that makes it a tuple. The parenthesis are only required in cases where the expression might mean something else without them. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list