Python clutter point of knowledge

Source: Internet
Author: User

1. = = = =

=

= =: Comparison values are equal

is: Compare, compare memory address

2. ID (content): Get the initial memory address of the content

3. Number, string, the existence of a small data pool concept, if you create the same number or string, and is a small range, but also assigned to two different names of variables, but these two variables will share the same memory.

The range of the digital small data pool is -5~256, if the number is within this range, and if more than one variable is created with this number equals this number, then these variables are actually using the same memory address.

String: If two identical strings contain special characters and are assigned to two variables, then these two variables will not use the same memory address, if the two same strings do not contain special characters, then the two variables use the same memory address. The small data pool pattern of strings needs to be explored later.

It is primarily a small data pool concept for both numbers and strings, primarily to save memory space

4. In addition to numbers and strings, the remaining Python data types do not have the concept of a small data pool.

Python clutter point of knowledge

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.