Speaking of CPython optimizations
> x = 124236
> y = 124237
> y -= 1
> id(x)
140474467900408
> id(y)
140474467900360
> x is y
False
> x = 1
> y = 2
> y -= 1
> id(x)
140558102245816
> id(y)
140558102245816
> x is y
True
> x = 124236
> y = 124237
> y -= 1
> id(x)
140474467900408
> id(y)
140474467900360
> x is y
False
> x = 1
> y = 2
> y -= 1
> id(x)
140558102245816
> id(y)
140558102245816
> x is y
True
http://stackoverflow.com/questions/306313/python-is-operator...