Checking if class is derived of some other class
Aahz
aahz at pythoncraft.com
Mon Apr 22 16:08:16 EDT 2002
In article <pan.2002.04.22.19.43.59.567352.5745 at teich.garten.DigitalProjects.com>,
Alexander Skwar <news.ASkwar at DigitalProjects.com> wrote:
>
>class a:
> pass
>
>class b(a):
> pass
>
>class c(b):
> pass
>
>myObject = c
>
>if isinstance(myObject, c):
> print "yes"
>else:
> print "No"
Try
myObject = c()
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
What if there were no rhetorical questions?
More information about the Python-list
mailing list