http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net
分类: Python/Ruby
2011-10-01 20:29:10
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++
如果想要查看一个类是否是另一个的子类,可以使用内建的issubclass函数:
++++++++++++++++++++++++++++++++++++++++++
如果想知道已知类的基类,可以直接使用它的特殊性__base__
+++++++++++++++++++++++++++++++++++++++++
同样,还能使用instance方法检查一个对象是否是一个类的实例:
++++++++++++++++++++++++++++++++++++++++++++++