Python Small Integer Caching: == versus is
This interesting code snippet was brought to my attention by Finxter reader Albrecht. You’d guess that the for loop goes from i=250 to i=259, each time incrementing a and b. As Python creates one integer object to which both names refer, the command a is not b should always be False. Thus, the result is … Read more