[Q] Type checking...
Fredrik Lundh
fredrik at pythonware.com
Mon Jul 19 08:29:26 EDT 1999
Olivier Deckmyn <olivier.deckmyn at mail.dotcom.fr> wrote:
> Abstract : [Q]How to check the type of an instance before(after?) sending it
> to a method...
also see:
http://www.python.org/doc/FAQ.html#4.47
"4.47 How do I check if an object is an instance
of a given class or of a subclass of it?"
which also points out that explicit class testing
might indicate bad design... it's usually more
"pythonish" to just expect a valid object, and
trust the "user" to figure out that what the
AttributeError exceptions mean...
</F>
More information about the Python-list
mailing list