isinstance will do the trick. class A:pass class B(A):pass class C(B):pass c = C() print isinstance(c, A) 1 If you need to traverse the bases: c.__class__.__bases__ // m -