This is actually do to some sneaky internal optimization by the Python interpreter. low integer values are cached objects, so they always refer to the same object. higher integer objects are instanced like regular python objects, so they do not refer to the same objects.>>> K_6 54 >>> 54 is K_6 True >>> K_KP4 260 >>> 260 is K_KP4 False Is this due to some inconsistency in the way the constants were declared?