面向对象的反射和一些魔法方法
摘要:类相关的内置函数 # 类相关的内置函数 # 1.isinstance 用于判断,对象是否是对应类型,返回True或者False 接收两个参数,(实例化的对象,类型) 如果存在继承关系也会返回True isinstance(1,int) # 2.issubclass 用于判断类于类之间的继承关系 例:
阅读全文
posted @ 2019-07-24 16:55
posted @ 2019-07-24 16:55
posted @ 2019-07-24 16:47
posted @ 2019-07-24 16:33
posted @ 2019-07-24 15:31
posted @ 2019-07-24 15:26
posted @ 2019-07-16 16:16