Open LilithHafner opened 8 months ago
Short answer: juliacall.convert
.
Long answer: I got conversion right in PythonCall but wrong in JuliaCall.
In your example, you start with a python tuple
of float
s, which is converted to a Tuple{Float64,Float64}
in Julia, which you then convert to a Tuple{Float32, Float32}
in Julia, pass back to Python which converts it to a Python tuple
of float
s, which you then pass back to Julia where it becomes a Tuple{Float64,Float64}
, hence the reported type.
In v1 I'm going to prevent this automatic conversion when passing values from Julia to Python, which will make code like this much simpler and predictable. You'll always get a Jl
back, just like in PythonCall you always get a Py
back.
I want to get my hands on a
Tuple{Float32, Float32}
in Python and there doesn't seem to be a good way of doing it