introspection question

Discussion in 'Python' started by Alex K, Jan 7, 2008.

  1. Alex K

    Alex K Guest

    Hi Guys,

    What would be the simplest way of enumerating all methods and members
    (including inherited) of a given object? Thank you.

    Alex
    Alex K, Jan 7, 2008
    #1
    1. Advertising

  2. Alex K

    Peter Otten Guest

    Alex K wrote:

    > What would be the simplest way of enumerating all methods and members
    > (including inherited) of a given object? Thank you.


    inspect.getmembers()

    Peter
    Peter Otten, Jan 7, 2008
    #2
    1. Advertising

  3. Alex K

    Alex K Guest

    Nice thank you. But anyway to make it look pretty?

    On 07/01/2008, Peter Otten <> wrote:
    > Alex K wrote:
    >
    > > What would be the simplest way of enumerating all methods and members
    > > (including inherited) of a given object? Thank you.

    >
    > inspect.getmembers()
    >
    > Peter
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Alex K, Jan 7, 2008
    #3
  4. Alex K

    Peter Otten Guest

    Alex K wrote:

    Please don't top-post.

    > On 07/01/2008, Peter Otten <> wrote:
    >> Alex K wrote:
    >>
    >> > What would be the simplest way of enumerating all methods and members
    >> > (including inherited) of a given object? Thank you.

    >>
    >> inspect.getmembers()


    > Nice thank you. But anyway to make it look pretty?


    Maybe

    $ /usr/bin/pydoc -p8080

    Otherwise you'd have to explain what you are trying to do.

    Peter
    Peter Otten, Jan 7, 2008
    #4
  5. 2008/1/7, Alex K <>:
    > Nice thank you. But anyway to make it look pretty?
    >


    pprint.pprint(inspect.getmembers(someobject))

    > On 07/01/2008, Peter Otten <> wrote:
    > > Alex K wrote:
    > >
    > > > What would be the simplest way of enumerating all methods and members
    > > > (including inherited) of a given object? Thank you.

    > >
    > > inspect.getmembers()
    > >
    > > Peter
    > > --
    > > http://mail.python.org/mailman/listinfo/python-list
    > >

    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >



    --
    -- Guilherme H. Polo Goncalves
    Guilherme Polo, Jan 7, 2008
    #5
    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. Stephen Nesbitt
    Replies:
    0
    Views:
    270
    Stephen Nesbitt
    Nov 22, 2004
  2. Benjamin Rutt
    Replies:
    4
    Views:
    387
    Mike Meyer
    Jul 8, 2005
  3. Replies:
    12
    Views:
    559
  4. jdonnell

    introspection question

    jdonnell, Sep 6, 2006, in forum: Ruby
    Replies:
    3
    Views:
    83
    jdonnell
    Sep 14, 2006
  5. Srijayanth Sridhar

    Introspection question

    Srijayanth Sridhar, Jul 14, 2008, in forum: Ruby
    Replies:
    3
    Views:
    78
    Srijayanth Sridhar
    Jul 15, 2008
Loading...

Share This Page