Exposing all methods of a class

Rick Johnson rantingrickjohnson at gmail.com
Wed Mar 1 21:41:29 EST 2017


On Wednesday, March 1, 2017 at 4:51:34 AM UTC-6, Terry Reedy wrote:
> The class listing provided by the pydoc module browser,
> also in help(someclass), do list all methods.  Try
>  >>> import tkinter
>  >>> help(tkinter.Text)
> for instance.
>
> On 2/28/2017 7:16 PM, Rick Johnson wrote:
> > IDLE has a "class browser" feature (@GUI_XY = File-
> > Class_Browser) that displays a GUI tree of the currently
> > opened module, although, and unfortunately for you, the
> > scope of detail ends at the physical borders of the
> > module.
>
> I'd like to rename that 'module browser after enhancing
> coverage of functions a bit.

Agreed. "Module Browser" is a far more intuitive name. And
since we all aware that IDLE needs an industrial quality
spit-shine, this could be a good first step!

A nice bonus feature (but potentially resource heavy) would
be a "include external dependancies" Checkbox that would
optionally expand the tree to include all imported module
structure as well (something akin to what the OP wanted, but
less "class centric"). Sure, it might be really slow if the
module has a ton of nested dependencies, but, it's not
something you'd need every day -- only when you're trying to
get a bird's-eye-view of an entire library, or package. And
this is where categorical methodologies like "Level Of
Detail" (LOD) become paramount to R&D. Because, you can
quickly become lost in a "sea of nodes" if the interface is
not properly designed.

> > However, by utilizing the introspection power of python
> > (`import inspect`, for instance), you could probably
> > implement something akin to "comprehensive introspection
> > reform".
>
> A real class browser, with the same info as in the help
> output, but more interactive, would be interesting.

Sure would. And a GUI interface affords you more latitude to
display complex/nested data structures in a manner that is
more conducive to eyeball-parsing -- as opposed to the
archaic and crass tactic of:

  sys.stdout.dump(umpteen_pages_of_text)

Nobody likes to be dumped on. ;-)


More information about the Python-list mailing list