@jamescooke It's not safe: that's an undocumented CPython implementation detail, and could change at any time. (Compare Java, where the equivalent behaviour is part of the language specification.) CPython is not the only implementation of Python.
You should not be writing code that relies on this behaviour in the first place. The decimal.Decimal limitation is a valid thing to be annoyed about (though it is documented), but is not working is not.
>>> 7832 is 7832
True