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
[color=blue][color=green][color=darkred]
>>> list.sort.__doc __[/color][/color][/color]
'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
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
[color=blue][color=green][color=darkred]
>>> list.sort.__doc __[/color][/color][/color]
'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
Comment