473,386 Members | 1,830 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,386 software developers and data experts.

Identify object class

Hi,
How do we quickly identify in Python if an object is of a specific
class *or* is of a class deriving directly or indirectly from that class?

BTW, don't you think this newsgroup has a lot of activity and it should
be time to make other newsgroups like comp.lang.python.windows, etc?

Thx and Regards,

Nicolas Fleury
Jul 18 '05 #1
2 3807
Nicolas Fleury wrote:
Hi,
How do we quickly identify in Python if an object is of a specific
class *or* is of a class deriving directly or indirectly from that class?

You want the isinstance built-in function. Example:

if isinstance(obj,cls): do_whatever()

BTW, don't you think this newsgroup has a lot of activity and it should
be time to make other newsgroups like comp.lang.python.windows, etc?

Good idea! I propose the following:

comp.lang.python.misc
comp.lang.python.gui
comp.lang.python.networking
comp.lang.python.dev
comp.lang.python.lisp-envy
--
CARL BANKS http://www.aerojockey.com/software

As the newest Lady Turnpot descended into the kitchen wrapped only in
her celery-green dressing gown, her creamy bosom rising and falling
like a temperamental souffle, her tart mouth pursed in distaste, the
sous-chef whispered to the scullery boy, "I don't know what to make of
her."
--Laurel Fortuner, Montendre, France
1992 Bulwer-Lytton Fiction Contest Winner
Jul 18 '05 #2

"Nicolas Fleury" <ni******@yahoo.com_remove_the_> wrote in message
news:ni*********************@nnrp1.uunet.ca...
BTW, don't you think this newsgroup has a lot of activity and it should be time to make other newsgroups like comp.lang.python.windows, etc?


The volume goes up and down, I believe (through probably trending up).
The last two weeks have been up withthe x lisp threads.

The idea of division has come up occasionally for several years, but
never any agreement on what the split might be. Also, there are about
50 specialized Python mailing lists. Go to news.gmane.org which
gateways lists to its own newsgroups and look as gmane.comp.python.*.

Terry J. Reedy
Jul 18 '05 #3

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

Similar topics

2
by: Metropolis | last post by:
Hello All, I am currently trying to teach a web crawler how to identify blogs, that is I am trying to determine a fairly inclusive set of criteria that will help my crawler to identify them. ...
8
by: DraguVaso | last post by:
Hi, I want my application do different actions depending on the exception it gets. For exemple: I have an SQL-table with a unique index. In case I try to Insert a record that's alreaddy in it I...
4
by: Nikhil | last post by:
I have a dll which is call by an ASP page, this dll has to perform read/write operations on a file, I seem to be encountering the following error" Process cannot access xyz.txt cause its held bby...
17
by: Alphonse Giambrone | last post by:
I am building a web app for users to add/edit data. They may add/edit several records during a session. When they are done (not necessarily immediately, could be 10 or more minutes later), I need...
7
by: Grahmmer | last post by:
I have a few timers that are added to a form at runtime. I can handle the event fine, but I cannot identify which timer fired. Is there a way to do this? Timer Creation: -------------...
3
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to...
4
by: Kenneth McDonald | last post by:
I'm trying to write a 'flatten' generator which, when give a generator/iterator that can yield iterators, generators, and other data types, will 'flatten' everything so that it in turns yields...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.