You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have just added conversion from Python named tuples to Julia named tuples on the main branch, it will be in the next release.
BTW your code is wrong, you need to call juliacall.convert not jl.convert. The difference between these is that jl.convert is just a generic wrapper around Julia's Base.convert function, but such wrappers already automatically convert their inputs. Previously, a Python named tuple would have been converted to a Julia tuple, so jl.convert(jl.NamedTuple, x) would end up calling convert(NamedTuple, (1, 2)), which is not what you want. Instead, juliacall.convert(jl.NamedTuple, x) ends up calling pyconvert(NamedTuple, x), which is what you do want.
Python named tuples will now be converted to Julia named tuples by default (instead of tuples) so in the future you should not even need to do this conversion yourself in most situations.
I cannot convert a python
namedtuple
to a juliaNamedTuple
. Here a minimal example:which results in the Error:
The text was updated successfully, but these errors were encountered: