Re:Python strings are immutable, but only sometimes
by th0ma5 on Monday February 15, 2021 @04:47PM
(#26147898)
This is outside of the spec... "is" is for testing the exact same reference and it is only coincidence that to speed things up they made smaller integers the same objects in memory. See:
What you want is double equals.
[ Parent
| on HN ]
Re:Python strings are immutable, but only sometimes
by oivey on Monday February 15, 2021 @05:15PM
(#26148222)
He names references in his post. I highly doubt he’s confused about the difference between is and ==. It’s a weird leak of interpreter details that could, in very narrow situations, cause a bug.