Preface
There is a standard Python implementation known as CPython. But it is not the only one, currently I'm working with alternative implementation named PyPy.
Problem
I have a strange inconsistency in behavior of PyPy & CPython implementations of Python3.5 on Windows 10 x64 with next snippet (thanks to @Gabriel, completed example)
>>> from itertools import repeat
>>> repeat(None, 2**31)
in CPython it gives
repeat(None, 2147483648)
while in PyPy it ends up in error with odd message
Traceback (most recent call last):
File "<input>", line 1, in <module>
OverflowError: int too large to convert to int
but when I try to execute this snippet in PyPy inside of Docker container
docker run -it pypy:3-6
it works fine, as CPython version.
I know that Windows version is in beta stage, but can anyone explain why it behaves like this and what does this error message say (or what it should say)?
Update
For CPython however next statement
>>> repeat(None, 2**63)
gives
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C ssize_t
are these errors somehow related?