flâneur — a map of the web's best reading

3. Data model — Python 3.12.4 documentation

docs.python.org · 20,587 words · saved by 1 readers

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.) 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. CPython implementation detail: For CPython, id(x) is the memory address where x is stored. 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. [1] The value of some objects can change. Objects whose value can change

3. Data model — Python 3.14.6 documentation Navigation index modules | next | previous | Python » 3.14.6 Documentation » The Python Language Reference » 3. Data model | Theme Auto Light Dark | 3. Data model ¶ 3.1. Objects, values and types ¶ Objects are Python’s abstraction for data. All data in a Python program is represented by objects or by relations between objects. Even code is represented by objects. 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

Explore this link on the map →

related reading