Where are list methods documented?

Tim Peters tim.peters at gmail.com
Tue Feb 1 13:22:13 EST 2005


[Tim Peters]
>> You could have found the above by, e.g., looking up "sort" in the
>> Library manual's index.

[Grant Edwards]
> I did.  I looked up sort in the library index, and it took me
> to 3.3.5 Emulating container types,

It doesn't for me.  Here:

    http://docs.python.org/lib/genindex.html#letter-s

There are two entries for "sort":

    sort (IMAP4_stream method)
    sort (list method)

You're looking for the second one <wink>.

...
> 
> I don't think it's at all obvious that the documentation for
> list.sort would be under "mutable sequence object".

I was just answering your question ("where are the docs?"), not trying
to imply you were an idiot for not guessing that.

You could have gotten to the same place in several ways.  Another
would have been to look up "list" in the Library index, and click on

    list
        type, operations on

For good or ill, the Library manual takes a rather abstract view of
the types currently implemented, as reflected in its table of
contents:

2. Built-In Objects 
    2.1 Built-in Functions 
    2.2 Non-essential Built-in Functions 
    2.3 Built-in Types 
        2.3.1 Truth Value Testing 
        2.3.2 Boolean Operations 
        2.3.3 Comparisons 
        2.3.4 Numeric Types 
        2.3.5 Iterator Types 
        2.3.6 Sequence Types 
        2.3.7 Set Types 
        2.3.8 Mapping Types 
        2.3.9 File Objects 
        2.3.10 Other Built-in Types 
        2.3.11 Special Attributes 
    2.4 Built-in Exceptions 
    2.5 Built-in Constants

So, e.g., it doesn't mention floats or dicts by those names either. 
It's well worthwhile to spend some time browsing that entire chapter.



More information about the Python-list mailing list