[issue2804] Integer right shift raises OverflowError when second operand is large

Mark Dickinson report at bugs.python.org
Fri May 9 23:15:05 CEST 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

> On the second thought, it is theoretically possible to have a long int 
a
> for which a >> maxsize is not zero

This occurred to me too; somehow this hardly seems worth worrying about-
--there are already other problems in longobject.c when integers get 
very large, and I don't think one more is going to hurt.  Perhaps a 
warning somewhere in the documentation would be appropriate.

(It seems to me that if anyone really cares, the *right* thing to do is
to limit all integers to be at most maxsize bits long.)

Thanks for the patch!  I'll take a look.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2804>
__________________________________


More information about the Python-bugs-list mailing list