Alex Groce added the comment: (to clarify: 0 << N allocates memory (which can fail, raising MemoryError) based on N. GMP simply returns 0 for any N. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue27870> _______________________________________