Message208229
I'm glad you caught that! First things first: the converted code should behave identically to the existing code, including raising the same exceptions. If you examine the exception hierarchy: http://docs.python.org/3.4/library/exceptions.html#exception-hierarchy you'll see that "OverflowError" is a subclass of "ArithmeticError". In other words, it represents when you perform an arithmetic operation that overflows the result type. Using it to also represent "you specified a value that is out of range for this conversion" seems wrong. So I like #3 as well. Could _PyLong_UnsignedInt_Converter catch the OverflowError raised by PyLong_AsUnsignedLong and reraise it as ValueError? | |
| Date | User | Action | Args | | 2014-01-16 02:36:07 | larry | set | recipients: + larry, georg.brandl, mark.dickinson, skrah, serhiy.storchaka | | 2014-01-16 02:36:07 | larry | set | messageid: <1389839767.37.0.7190810646.issue20260@psf.upfronthosting.co.za> | | 2014-01-16 02:36:07 | larry | link | issue20260 messages | | 2014-01-16 02:36:06 | larry | create | | |