suppose you have:
class F:
pass
then you make an instance:
g=F()
how can i check if the instance g is derived from the main class F?
suppose you have:
class F:
pass
then you make an instance:
g=F()
how can i check if the instance g is derived from the main class F?
You can do this:
if isinstance(obj, MyClass):
print "obj is my object"
So for your example:
if isinstance(g, F):
print "obj is my object"
Use this at your peril, sometimes it's Easier to Ask Forgiveness than Permission.