Python internal type, Python type

Source: Internet
Author: User

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

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.