Zitat von "M.-A. Lemburg" <mal@egenix.com>:
PyInts already have all the optimizations you have on your agenda for PyLongs, so I wonder why you're trying to duplicate all this work, instead of building upon it and adding the PyLong features to PyInts.
Because it doesn't matter. The code would be the same in the end, either way: it has to support two cases if two different internal representations are chosen. If you worry about the efficiency of the arithmetic operations: these are TRIVIAL in intobject.c, except for the overflow handling. What specific optimizations do you think the int implementation has?
Maybe I'm missing something, but this looks like a much more natural approach to me.
After reading your messages, it seems that you are missing the fact that there aren't really any optimizations in the int type, except for the custom allocator (which predates obmalloc) and the singleton cache for small ints (which is trivial to move to longs). Regards, Martin