On Mon, 06 Sep 2010 13:20:01 +0200 Stefan Behnel <stefan...@behnel.de> wrote: > > > (2) Integer arithmetic seems to go straight from 32-bits to long > > integers; why not use 64-bits before needing long integers? > > You are making assumptions based on Python 2, I guess. Try Python 3.1 or > later instead, where the int and long types are unified. Also, the > implementation is a bit more complex than you appear to be thinking. Don't > forget that it has received serious benchmarking based optimisations.
The optimizations are mainly related to big integer arithmetics, though. For small ints the main cost is interpretation and unboxing overhead as always. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list