Where are list methods documented?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hans Nowak

    #16
    Re: Where are list methods documented?

    Nick Craig-Wood wrote:
    [color=blue]
    > Since I'm a unix person, I would have typed
    >
    > pydoc -k sort
    >
    > But it doesn't come up with anything useful :-([/color]

    FYI, you can get this info using the not-very-intuitive

    pydoc __builtin__.lis t.sort

    e.g.

    (C:\Python23\Li b) $ pydoc __builtin__.lis t.sort
    Help on method_descript or in __builtin__.lis t:

    __builtin__.lis t.sort = sort(...)
    L.sort(cmpfunc= None) -- stable sort *IN PLACE*; cmpfunc(x, y) ->
    -1, 0, 1

    (Rather terse...)

    Info on the sort function (together with all the other list methods) is
    also available if you do

    pydoc list

    ....but for some reason, "pydoc list.sort" doesn't work on my machine
    (Python 2.3.4, Windows XP).

    --
    Hans Nowak
    Memimpin Angin Perubahan Teknologi


    Comment

    • Bryan

      #17
      Re: Where are list methods documented?

      Skip Montanaro wrote:[color=blue]
      > Grant> where are the methods of basic types documented?
      >
      > The other day I suggested the most valuable doc page to bookmark is the
      > global module index. Here's a demonstration. Start at:
      >
      > http://www.python.org/dev/doc/devel/modindex.html
      >
      > Click "__builtin_ _", which takes you to
      >
      > http://www.python.org/dev/doc/devel/...e-builtin.html
      >
      > Click the "2" in "See Chapter 2", which takes you to
      >
      > http://www.python.org/dev/doc/devel/...n.html#builtin
      >
      > Scroll down to section 2.3.6 and choose your sequence poison.
      >
      > I use the dev docs instead of the latest release docs because I generally
      > run from CVS on my system, however in this case it has the added advantage
      > that the link on the __builtin__ page is more useful.
      >
      > Skip
      >
      >
      >[/color]


      wow, that's pretty obscure. i barely even saw the link to chapter 2. i always
      the modules index page open and i always wished there was an explicit link to
      lists, tuples, dict, set, etc. maybe these explicit links could be at the top
      of the __builtins__ page.

      bryan

      Comment

      • Dennis Lee Bieber

        #18
        Re: Where are list methods documented?

        On 01 Feb 2005 18:46:35 GMT, Grant Edwards <grante@visi.co m> declaimed
        the following in comp.lang.pytho n:
        [color=blue]
        >
        > Aargh. My bad. I was in the language reference index. I seem
        > to have a very hard time ending up in the document I'm trying
        > for. For some reason, I fairly consistently click on the wrong
        > link in the document index. :([/color]

        Read the language reference once, then forget it exists <G>

        The Python language, itself, is so small you should seldom need
        the language reference. After all, how often do you need to look up the
        syntax for def, class, try/except... <G>

        Practically all the details of what can be done with data hides
        in the library manual.

        --[color=blue]
        > =============== =============== =============== =============== == <
        > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
        > wulfraed@dm.net | Bestiaria Support Staff <
        > =============== =============== =============== =============== == <
        > Home Page: <http://www.dm.net/~wulfraed/> <
        > Overflow Page: <http://wlfraed.home.ne tcom.com/> <[/color]

        Comment

        Working...