Re: Question about tuple lengths

2005-12-15 Thread Larry Bates
Carl J. Van Arsdall 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? Additiona

Re: Question about tuple lengths

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 09:54:31 -0800, Carl J. Van Arsdall wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") There is a special place in Hell reserved for people who overwrite built-in functions like tuple(), list(), str() and so forth. *wink* > >>> len(tuple) > 4 Brackets on t

Re: Question about tuple lengths

2005-12-14 Thread Dave Hansen
On Wed, 14 Dec 2005 12:58:16 -0500 in comp.lang.python, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: [...] > >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. That's almost true. Consider: >>> t2 =

Re: Question about tuple lengths

2005-12-14 Thread MM Zeeman
Carl J. Van Arsdall 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?

Re: Question about tuple lengths

2005-12-14 Thread Jean-Paul Calderone
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 t

Question about tuple lengths

2005-12-14 Thread Carl J. Van Arsdall
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? -- Carl J. Van Arsdall [EMAIL PROTECTED] Build