Selon la documentation pythonOverflowError est réellement levé?
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) and for most operations with
plain integers, which return a long integer instead. Because of the
lack of standardization of floating point exception handling in C,
most floating point operations also aren’t checked.
En effet, cette erreur avait un sens quand les entiers débordantes ne sont pas convertis en temps automatiquement. De même, les flotteurs débordent à inf
. Je ne vois pas vraiment de situation où l'interpréteur standard peut toujours déclencher OverflowError. Y a-t-il un tel cas quelque part? Juste une curiosité.
ok, intéressant. Je m'attendais à ce qu'il soit converti en "inf". >>> a = 1e1000 >>> a inf' –