> the only thing that changed in Python 3 was that they renamed the long type to int
Python 2.x had two types: int and long. Transitions from int to long were pretty seamless and the two types were somewhat compatible. This is not unification: there were still two separate types.
Python 3 has one type called int that functions mostly like long. You can sort of say (I guess) that "long was renamed to int", but only if you say "and int was removed": really, the types were unified.
As far as I knew, the only thing that changed in Python 3 was that they renamed the long type to int, and they also removed L suffix. But from your code seems that other things have changed as well and now two structures are used for short integers. Do you know when this happened exactly and why?