Other classes in a module

R

Roland Hedberg

Hi!

Can an instance of a class in a module, in any simple way find out which
other classes that exists in said module ?

-- Roland
 
P

Peter Otten

Roland said:
Can an instance of a class in a module, in any simple way find out which
other classes that exists in said module ?

set(v for v in globals().values() if inspect.isclass(v) and v.__module__ ==
__name__)

Peter
 

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
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top