[issue29833] Avoid raising OverflowError if possible

Raymond Hettinger report at bugs.python.org
Sat Mar 18 20:35:25 EDT 2017


Raymond Hettinger added the comment:

> I don't expect that any code rely on OverflowError. 
> ...
> As MemoryError, it's not common to catch these exceptions.

So why bother making any changes here at all?  It seems like an invented problem resulting in unnecessary churn, creating more work for downstream implementations and test suites.  It isn't even clear that Python will be any better after the change.

One thing I'm strongly against is changing the published C API for things like PyLong_AsUnsignedLong, https://docs.python.org/3/c-api/long.html#c.PyLong_AsUnsignedLong .  Also, in the content of converting to and from fixed-width C type, an OverflowError seems like exactly the right error.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29833>
_______________________________________


More information about the Python-bugs-list mailing list