Python internal type, Python type
Python uses the object model to store data. 1. Identity: each object has a unique identity. You can use the built-in function id () to obtain the identity of any object. This value can be considered as the memory address of the object 2. type: the type of the object determines what type of value the object can save, what operations it can perform, and what rules it follows. You can use the built-in function type () to view the rules. 3. Value: data items represented by objects. The above three features are assigned a value when an object is created. Except for values, the other two features are read-only. Internal type: (1) code object: The Code object is a compiled Python source code snippet, which is an executable object and can be obtained through the built-in function compile, code objects can be executed by exec commands or eval () built-in functions. The Code object itself does not contain any execution environment information. It is the core of a user-defined function and dynamically obtains the context when it is executed. (2) frame object: indicates the execution stack frame of Python. (3) tracking record object: When a code error occurs, Python will cause an exception. When an exception occurs, A tracing record object containing stack tracing information for exceptions will be created. (4) slice object: Step slice, multi-dimensional slice sequence, omitted slice. (5) omitted object: Used as a mark. (6) XRange object