Simon Percivall <[EMAIL PROTECTED]> wrote: ... > with static typing. The equivalent in Python would have been if an > overflow exception was raised when the int got too big. It might have > been that way, typing or no typing.
Indeed, it _used_ to be that way -- <http://docs.python.org/lib/module-exceptions.html> STILL says...: exception OverflowError Raised when the result of an arithmetic operation is too large to be represented. This cannot occur for long integers (which would rather raise MemoryError than give up). Because of the lack of standardization of floating point exception handling in C, most floating point operations also aren't checked. For plain integers, all operations that can overflow are checked except left shift, where typical applications prefer to drop bits than raise an exception. Actually, the docs are obsolete on this point, and an int becomes a long when that's necessary: >>> sys.maxint+1 2147483648L but, this operation _would_ have raised OverflowError in old-enough versions of Python (not sure exactly when the switch happened...). Alex -- http://mail.python.org/mailman/listinfo/python-list