How on earth does the is in Python judge? Ask Daniel for an answer

I entered:

on the command line
a, b = 1, 1
a is b    -sharp True

a, b = 1.1, 1.1
a is b    -sharp True

:
a = 1.1
b = 1.1
a is b    -sharp False  

int:
a = 1
b = 1
a is b:   -sharp True

:
a = 1.1
b = a
a is b:   True

when assigning values to an and b separately, if the value is floating-point, using is to compare two values means that the False int type does not exist
does not understand why

solve the puzzle

Feb.23,2022

1. First of all, about is , as mentioned above, is determines whether the two variables point to the same area of memory, that is, whether the id of the variable is the same.

2. The subject needs to understand the concept of small integer object pool . Because in general, the use of small integers [- 5256] is relatively frequent, python establishes small integer object pool in order to optimize speed, that is to say, these small integers are unique in memory. Therefore:

  https://github.com/leisurelic.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b4126e-2bdc3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b4126e-2bdc3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?