determining the source code and module based on the class

A

alf

Hi,

Let's say I have a class defined somewhere:

class A:
pass



now I import (indirectly) a module defining that class (and in fact
thousands of others defined in hundreds of modules) where all I have is
a list of them provided:

l=[A,B,C]


now I need a piece of code which based on the class name can point to
the module as well as the line number where the given class is defined.

Is it doable in Python?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top