For whatever reason, I need an inproved integer. Sounds easy, let's just subclass int:
>>> class test(int):
pass
Now let's test it:
>>> zed=test(0)
>>> zed.__class__
<class '__main__.test'>
>>> zed
0
So far, so good. Now let's try incrementing:
>>> zed+=1
>>> zed
1
>>> zed.__class__
<type 'int'>
WTF??!
Is this a bug or is it the inevitable result of optimizing for the
case where all integers are indistinguishable?
--
http://mail.python.org/mailman/listinfo/python-list
