473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Other classes in a module

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
Mar 25 '07 #1
1 985
Roland Hedberg wrote:
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

Mar 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Paulo Pinto | last post by:
Hi, I have a package that generates classes from a set of XML files using exec. So far the classes appear in the global namespace. Is there any way to also create packages dinamicaly and...
9
by: Zunbeltz Izaola | last post by:
Hi to all! I wonder if it possible (i'm sure python can do :-) ) to define classes on runtime. My problem (schematically) is the folowwin. The User can choise betwenn 3 property of an object....
12
by: David MacQuigg | last post by:
I have what looks like a bug trying to generate new style classes with a factory function. class Animal(object): pass class Mammal(Animal): pass def newAnimal(bases=(Animal,), dict={}):...
1
by: mathieu gontier | last post by:
Hi every body I am tring to create new Python modules. In a first time, I have created a module named FOO in which I have inserted new classes. No problem : PyMODINIT_FUNC initFOO( void )...
8
by: Jeff S | last post by:
Please note that this question is NOT about any particular pattern - but about the general objective of separating out presentation logic from everything else. I'm trying to "get a grip" on some...
0
by: Dr. Peer Griebel | last post by:
I'm currently writing a small toy application to support symbolic algebra. Therefore I implemented some classes Term, Var, Number, Sum, Product, Power. These classes are tightly coupled. So it...
21
by: glenn | last post by:
hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base...
7
by: Manuel Bleichner | last post by:
Hello list, I have searched for some time now, but no result... I'm having the following problem: In a module I have a huge number of classes of the form: class A(object): connected_to = ...
9
by: Stef Mientki | last post by:
I want to have a (dynamically) list of all classes defined in a py-file. Is there a way of getting this list, without manually parsing the file ? thanks, Stef Mientki
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.