examining python objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Colin J. Williams

    #16
    Re: examining python objects

    rurpy@yahoo.com wrote:[color=blue]
    > Bruno Desthuilliers wrote:
    >[color=green]
    >>rurpy@yahoo.c om a écrit :
    >>[color=darkred]
    >>>Is there a function/class/module/whatever I can use to
    >>>look at objects? I want something that will print the object's
    >>>value (if any) in pretty-printed form, and list all it's attributes
    >>>and their values. And do all that recursively.
    >>>I want to be able to find out everything about an object that
    >>>Python can introspectively find out.[/color]
    >>
    >>Then check the inspect module[/color]
    >
    >
    > I want a callable, ready-to-use class or function.
    > Inspect provides soime funtions that would be useful for wrinting
    > such a class or function, but does not provide one.
    >
    > I seems that nobody who has written or used such a tool reads
    > this group, or feels like responding.
    >
    > FWIW, (for anyone looking for something similar in the future)
    > I found http://aspn.activestate.com/ASPN/Coo.../Recipe/137951
    > which will format and print an object's attributes. By combining that
    > and pprint in the Python distrib, I think can coble up what I am
    > looking
    > for.
    >
    > Still, it is discouraging that such a basic thing is not provided with
    > python, or at lleast easily available in some library.
    >[/color]
    In the interactive mode, you might try >> help(object)

    Colin W.

    Comment

    • Colin J. Williams

      #17
      Re: examining python objects

      rurpy@yahoo.com wrote:[color=blue]
      > Bruno Desthuilliers wrote:
      >[color=green]
      >>rurpy@yahoo.c om a écrit :
      >>[color=darkred]
      >>>Is there a function/class/module/whatever I can use to
      >>>look at objects? I want something that will print the object's
      >>>value (if any) in pretty-printed form, and list all it's attributes
      >>>and their values. And do all that recursively.
      >>>I want to be able to find out everything about an object that
      >>>Python can introspectively find out.[/color]
      >>
      >>Then check the inspect module[/color]
      >
      >
      > I want a callable, ready-to-use class or function.
      > Inspect provides soime funtions that would be useful for wrinting
      > such a class or function, but does not provide one.
      >
      > I seems that nobody who has written or used such a tool reads
      > this group, or feels like responding.
      >
      > FWIW, (for anyone looking for something similar in the future)
      > I found http://aspn.activestate.com/ASPN/Coo.../Recipe/137951
      > which will format and print an object's attributes. By combining that
      > and pprint in the Python distrib, I think can coble up what I am
      > looking
      > for.
      >
      > Still, it is discouraging that such a basic thing is not provided with
      > python, or at lleast easily available in some library.
      >[/color]
      In the interactive mode, you might try >> help(object)

      Colin W.

      Comment

      • rurpy@yahoo.com

        #18
        Re: examining python objects

        Colin J. Williams wrote:[color=blue]
        > rurpy@yahoo.com wrote:[color=green]
        > > Bruno Desthuilliers wrote:
        > >[color=darkred]
        > >>rurpy@yahoo.c om a écrit :
        > >>
        > >>>Is there a function/class/module/whatever I can use to
        > >>>look at objects? I want something that will print the object's
        > >>>value (if any) in pretty-printed form, and list all it's attributes
        > >>>and their values. And do all that recursively.
        > >>>I want to be able to find out everything about an object that
        > >>>Python can introspectively find out.
        > >>
        > >>Then check the inspect module[/color]
        > >
        > >
        > > I want a callable, ready-to-use class or function.
        > > Inspect provides soime funtions that would be useful for wrinting
        > > such a class or function, but does not provide one.
        > >
        > > I seems that nobody who has written or used such a tool reads
        > > this group, or feels like responding.
        > >
        > > FWIW, (for anyone looking for something similar in the future)
        > > I found http://aspn.activestate.com/ASPN/Coo.../Recipe/137951
        > > which will format and print an object's attributes. By combining that
        > > and pprint in the Python distrib, I think can coble up what I am
        > > looking
        > > for.
        > >
        > > Still, it is discouraging that such a basic thing is not provided with
        > > python, or at lleast easily available in some library.
        > >[/color]
        > In the interactive mode, you might try >> help(object)[/color]

        I want all the information about the object I can get through
        introspection. help() give some (a lot more than I realized,
        so thanks) but not everything.

        Comment

        Working...