t531.py 296 B

12345678910111213141516171819202122
  1. class Foo:
  2. pass
  3. class Bar(Foo):
  4. pass
  5. class Baz(Bar):
  6. pass
  7. class XXX:
  8. pass
  9. class Frob(Baz,XXX):
  10. pass
  11. print issubclass(Bar,Foo)
  12. print issubclass(Foo,Bar)
  13. print issubclass(Baz,Foo)
  14. print issubclass(Baz,Bar)
  15. print issubclass(Foo,object)
  16. print issubclass(Frob,XXX)