Where are list methods documented?

Grant Edwards grante at visi.com
Tue Feb 1 12:21:01 EST 2005


I'm trying to figure out how to sort a list, and I've run into
a problem that that I have tripped over constantly for years:
where are the methods of basic types documented?  The only
thing I can find on a list's sort() method is in the tutorial
where it states:

   sort()
       Sort the items of the list, in place. 

Doesn't the list method would accept a callable to be used as a
comparison function?  Where is that sort of thing in the
documentation?  I've looking in the library reference, the
language reference, the global module index.

I have figured out I can do 

>>> list.sort.__doc__
'L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1'

-- 
Grant Edwards                   grante             Yow!  But they went to MARS
                                  at               around 1953!!
                               visi.com            



More information about the Python-list mailing list