Python 高级编程和异步IO并发编程 –02_2 type/object/class之间的关系
a = 1 b = "abc" print(type(1)) print(type(int)) print(type(int)) print(type(str)) # type -> int -> 1 # type -> str -> obj # object是最顶层基类 # type 本身也是一个类,同时type本身也是一个对象 class Student: pass class My_Student(Student): pass stu = Student() print(type(stu)) print(type(Student)) print(int.__bases__
用户评论