Mark Dickinson <dicki...@gmail.com> added the comment:

Patch that unoutrages Python attached:  it allows shift counts of up to 
sys.maxsize in both left shift and right shift.  I don't have a test for this, 
since the only tests I can think of (e.g. actually doing 1 << (2**31)) require 
> 270Mb of RAM, and that may be too much for some of the buildbots.  (We could 
add a 'largemem' special resource to regrtest, I suppose, but it doesn't seem 
worth the effort just for this.)

This patch doesn't solve the OPs problem, though.  The PyLong code *could* be 
modified to accept larger shift counts (e.g., up to 8*PY_SSIZE_T_MAX;  beyond 
this you'll get a MemoryError anyway), but this seems like a significant effort 
for little gain.  It might make more sense for right shifting, though.  Anyway, 
I'd definitely call that a feature request.

----------
assignee:  -> mark.dickinson
keywords: +patch
Added file: http://bugs.python.org/file16783/no_outrage.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8259>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to