isinstance

class Foo:
    pass
obj = Foo()

isinstance(obj,Foo)

class Foo:
    pass
obj = Foo()
isinstance(obj ,Foo)
print(obj)

class Foo:
    pass
class Bar(Foo):
    pass
issubclass(Bar,Foo)
print(Bar)

  

posted @ 2016-12-27 10:26  打不死的--蟑螂  阅读(92)  评论(0编辑  收藏  举报