[BUG] PythonObject
doesn't handle large UInt64
correctly
#3510
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
mojo-repo
Tag all issues with this label
Bug description
As title.
A Mojo
UInt64
value went through the following to reach Python runtime:PythonObject.__init__[dt: DType](Self, SIMD[dt, 1])
mojo/stdlib/src/python/python_object.mojo
Lines 294 to 296 in 61d8208
CPython.toPython(Self, Int)
mojo/stdlib/src/python/_cpython.mojo
Lines 966 to 967 in 61d8208
CPython.PyLong_FromLong(Self, Int)
mojo/stdlib/src/python/_cpython.mojo
Lines 889 to 902 in 61d8208
PyLong_FromLong
with signaturePyObject *PyLong_FromLong(long v)
An unwanted bit cast happened on CPython's API boundary.
We should
PythonObject.__init__
PyLong_FromUnsignedLong
onstruct CPython
Steps to reproduce
A more peculiar repro:
System information
The text was updated successfully, but these errors were encountered: