
report at bugs
May 9, 2008, 5:27 PM
Post #8 of 11
(454 views)
Permalink
|
|
[issue2804] Integer right shift raises OverflowError when second operand is large
[In reply to]
|
|
Alexander Belopolsky <belopolsky [at] users> added the comment: On Fri, May 9, 2008 at 7:08 PM, Martin v. Löwis <report [at] bugs> wrote: .. > I'm -1 on this patch (or any other fixing the perceived problem). > Special cases aren't special enough to break the rules. > > If you ever see this error in a real application, you have deeper > problems than the exception. That was my first reaction as well, but then I thought that it was easy to fix because the answer is guaranteed to be 0 for ridiculously large right shifts. However, since the patch is not theoretically correct, I would only be +0 on applying it. I also note that the current requirement is that shift fits long rather than Py_ssize_t, which may lead to a >> sys.maxsize being invalid on platforms where sizeof(long) < sizeof(Py_ssize_t). This may be a problem because sys.maxsize is likely to be used as a placeholder for an arbitrary large number. This said, I sill don't feel strongly one way or another. __________________________________ Tracker <report [at] bugs> <http://bugs.python.org/issue2804> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|