March 31, 2020
8:09 a.m.
I understand it locks in that particular implementation detail, but it also seems unlikely that that particular optimization (int 0 and int 1 as specific memory objects) would ever make sense to NOT be including in a shipping implementation (future proof by practicality).
Do you explicitly want to differentiate between *CPython integer* 0's and 1's and floats? How about Numpy and other numeric libraries? assert 0.0 is not 0 assert 1.0 is not 1 assert numpy.ones(1, dtype=int)[0] is not 1 assert numpy.int8(1) is not 1 I think you're going to cause sneaky bugs for yourself.