[Tutor] tuple sorting

Eric Black ericblack69@yahoo.com
Thu, 6 Jun 2002 07:14:48 -0700 (PDT)


Hello all,
I am a newbie who's been lurking here for a couple of
months now and I just love this list. 

While considering the May 20 post of 
Raymond Hettinger:

Convert the outer tuple to a list so that it can be
sorted:

>>> a = ((4,1,8), (9,2,5),(3,6,9))
>>> b = list(a)
>>> b.sort()
>>> a = tuple(b)
>>> print a
((3, 6, 9), (4, 1, 8), (9, 2, 5))

I guess I found a very trivial typo in the
distribution. Is this worth reporting?
>>> tuple(  # the popup says: --> list, not tuple.
>>> tuple.__doc__() ## has the same typo.
'tuple(sequence) -> list\n\nReturn a tuple whose items
are the same as those of the argument sequence.\nIf
the argument is a tuple, the return value is the same
object.'
>>>

This gave me the ambition to rummage in the innards of
python. I know there is a doc string somewhere in the
source but after using windows find tool looking in
C:\Python21 for the text I couldn't find the physical
file where it's located. I am running the windows
executable version of 
Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit
(Intel)] on win32
The entries in 7.3.4 Tuple Objects of the Python/C API
Reference Manual imply C code is involved.
If someone could explain where the doc string is and
how to rummage in the innards I would appreciate it.

                    TIA,
                    Eric Black

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com