Everything is an object in Python
本文主要想解决的问题是:在Python中什么是“一切皆对象”? 什么是对象? 在Python官方术语对照表中是这样定义的: Object: Any data with state (attributes or value) and defined behavior (methods). 什么是属性(attribute)和方法(method): Attribute: A value associated with an object which is usually referenced by name using dotted expressions. Method: A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first argument (which is usually called self). 什么是函数(function)和类(class):...