Re: fetching method names from a class,and the parameter list from a method

Discussion in 'Python' started by John Lenton, Jan 11, 2005.

  1. John Lenton

    John Lenton Guest

    On Mon, Jan 10, 2005 at 08:29:40PM +0100, Philippe C. Martin wrote:
    > Is this possible ?
    >
    > I am trying to have auto-completion working in a shell I wrote but I
    > currently have the method lists done by hand (ie; if I add/subtract a
    > method from that class, then my auto-completion is out of date).
    >
    > Same issue with method parameters.
    >
    > I have parsed through many of the attributes (ex: I use method.__doc__)
    > but have not yet found a way to achieve the above goal.
    >
    > Is there a way? something like the following would be great:
    > 1) list = Class.__methods__
    > 2) dict (because of default values: "param = None") =
    > Class.__method__[0].__params__


    >>> import inspect
    >>> help(inspect)


    HTH

    --
    John Lenton () -- Random fortune:
    In Greene, New York, it is illegal to eat peanuts and walk backwards on
    the sidewalks when a concert is on.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.5 (GNU/Linux)

    iD8DBQFB42A5gPqu395ykGsRAtDcAKC4vwU2GnnHnnweqe69So8blS2woQCeJ5c5
    ooX8M7Y54hPpwuBOmBwrAoo=
    =XVfn
    -----END PGP SIGNATURE-----
    John Lenton, Jan 11, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ares Lagae
    Replies:
    8
    Views:
    443
    Ares Lagae
    Sep 24, 2004
  2. Philippe C. Martin
    Replies:
    0
    Views:
    262
    Philippe C. Martin
    Jan 10, 2005
  3. Jeff Cohen
    Replies:
    6
    Views:
    133
  4. Sfdesigner Sfdesigner
    Replies:
    5
    Views:
    157
    Chris Shea
    Aug 13, 2007
  5. Mumia W.
    Replies:
    1
    Views:
    77
    -berlin.de
    Aug 10, 2006
Loading...

Share This Page