I am trying to get info about the classes in my running system. Having
gotten the modules, I wanted to get the classes defined in them. However,
classes = inspect.getmembers(module,inspect.isclass)
returns an empty list. This surprised me, so I inspected the __dict__ of the
module; the classes are not there, either (presumably that is where
getmembers() is getting its info). Am I missing something obvious? How
should I be getting the classes?

So that you understand why I'm asking, I am trying to implement a trace
(debugging purposes) that shows
call module.class.method(args...)
return module.class.method -> retvalue
for each method/function entered. Since I can only get the underlying
function (not class.method) in the sys.settrace() module, I am trying to
pre-parse my classes to find starting line numbers for methods, in order to
be able to correlate them with the functions I get in sys.settrace(). If
there is a much easier way to do this, I am open to suggestions, but please
answer the above question, also; it's got me bugged!

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
grouppython-list @
postedAug 19, '02 at 11:01p
activeAug 20, '02 at 5:29p



site design / logo © 2022 Grokbase