That apparently got changed here, in Python 3.11 the is check now gives True:
Is it still possible to create new small int objects in some other way? (In a “nice” way, I mean, I guess I could still create a new int object with a larger value and use ctypes to change its value, but that’s ugh…)
Well, I only used it a few times, and I think mostly to demonstrate that it’s possible. I only remember one time where I “seriously” used it to create a new object because I both needed the number and needed a “marker” object to identify something with certainty (similar to sentinel = object()), so I created a new number object to achieve both aspects.
Yep, but it would lose its “flagginess”. That’s the usual complaint with subclassing builtins - it takes a lot of work to make arithmetic correctly return the subclass in all situations. But in this case, it will behave exactly as the “normal” integer would, and as soon as you do arithmetic, you just get back normal integers.
You may also want to consider IntEnum though, as it may be suitable for “it’s an integer, but it has special meaning too”.