Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
confused about Python assignment
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Peter Hansen, post: 1734987"] It's equally "obvious" with integers, if you pick values above 99 or below -5 (found by experimentation this time, as my memory is always poor, and using Python 2.3.1). Try a = 99 b = 99 a is b (returns True) a = 100 b = 100 a is b (returns False) Values between -5 and 99 inclusive are basically pre-created and "interned" so that you never get multiple integer instances with the same values in this range. Those outside this range are not treated specially like this. -Peter [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
confused about Python assignment
Top