Reply content:
The idea of the difference between "row by line" and "whole interpretation" is right, but the details are not. Here are some details.
It doesn't matter with sublime and idle.
$ pythonPython 2.7.5 (default, Mar 9 the, A: the: to) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0. the)] on DarwinType "Help", "Copyright", "Credits" or "License" for More Information.>>> a = 10.1>>> b = 10.1>>> a is bFalse>>> ID(a)140475784803760>>> ID(b)140475784803736>>> (10.1) is (10.1)True>>> def Foo():... a = 10.1... b = 10.1... return a is b... >>> Foo()True
isis the identity, if the two variable ID (address) is the same, then A is B is true;
So from the implementation of the results, it is also consistent.
As for the difference in the question, that is to achieve the relevant, like 10.1 such small Whether number is re-assigned will reuse the ID that is implementation related (my 2.7.6 is a different ID), and I estimate that sublime itself has a Python runtime (not quite sure, I don't use sublime), so there will be different performance. Bury yourself a hole, today suddenly think of a possibility, because idle is an explanation of the command, and Python floating point in the heap memory, each time a floating-point number is created, the heap memory address will be directly stacked, when creating the same floating point, idle will also perform repetitive actions, and when written to the script, When executed with an interpreter, a simple numeric object is checked to see if the object is already present (the value object is more simple to repeat), so that the existing heap address can be stacked directly.
It should be the Python interpreter existence W said the runtime, how to see the interpreter after the implementation process to understand. Wait for pits later.