一、摘自Python Documentation 3.5.2的解釋html
Objects are Python’s abstraction for data. All data in a Python program is represented by objects or by relations between objects. (In a sense, and in conformance to Von Neumann’s model of a 「stored program computer,」 code is also represented by objects.)ide
對象是Python對數據的抽象。Python程序中的全部數據都由對象或對象之間的關係表示。(在某種意義上,而且符合馮·諾依曼的「存儲程序計算機」的模型,代碼也由對象表示的)。函數
Every object has an identity, a type and a value. An object’s identity never changes once it has been created; you may think of it as the object’s address in memory. The ‘is
‘ operator compares the identity of two objects; the id()
function returns an integer representing its identity.spa
每一個對象都有一個標識,一個類型和一個值。對象的身份一旦建立就不會改變; 你能夠把它看做內存中的對象地址。is運算符比較兩個對象的標識; id()函數返回一個表示其身份的整數。設計
An object’s type determines the operations that the object supports (e.g., 「does it have a length?」) and also defines the possible values for objects of that type. The type() function returns an object’s type (which is an object itself). Like its identity, an object’s type is also unchangeable.code
對象的類型決定對象支持的操做(例如,「它有長度嗎?」),而且還定義該類型對象的可能值。type()函數返回一個對象的類型(它是一個對象自己)。與它的身份同樣,對象的類型也是不可改變的。orm
二、Pyhtml的解釋:htm
object:對象
class object The most base type
type:blog
class type(object) type(object_or_name, bases, dict) type(object) -> the object's type type(name, bases, dict) -> a new type
從上圖能夠看出,對象obeject是最基本的類型type,它是一個總體性的對數據的抽象概念。相對於對象object而言,類型type是一個稍微具體的抽象概念,說它具體,是由於它已經有從對象object細化出更具體抽象概念的因子,這就是爲何type(int)、type(float)、type(str)、type(list)、type(tuple)、type(set)等等的類型都是type,這也是爲何instance(type, object)和instance(object, type)都爲True的緣由,即類型type是做爲object、int、float等類型的總體概念而言的。那麼,爲何issubclass(type, object)爲True,而issubclass(object, type)爲Flase呢?從第二張圖,即從繼承關係能夠看到,type是object的子類,所以前者爲True,後者爲False。從Python語言的總體設計來看,是先有對象,後有具體的類型,即對象產生類型,類型從屬於對象,二者是相互依存的關係。因此: