PythonCall.jl
PythonCall.jl copied to clipboard
add pyconvert(x)
For convenience, it would be nice to expose
pyconvert(x) = pyconvert(Any, x)
Perhaps, but you generally shouldn't be using pyconvert(Any, x)
, you should use a more specific type. The only good reasons I can see for pyconvert(Any, x)
are:
- Interactive use, where you already know the conversion will do what you want.
- Generic programming, where you don't actually know anything about
x
.
Those 2 usage examples seem pretty common. Moreover, I would find it very useful to have a pyconvert(Any, x)
with a recursive behavior, something like what I poorly implemented https://github.com/CarloLucibello/HuggingFaceDatasets.jl
I've previously had discussions about adding a function pyconvertnative(x)
which converts x
(recursively) to a 'native' Julia object if possible (list
to Vector
, dict
to Dict
etc.).
I just added my two cents to the pyconvertnative()
discussion, see #128
Maybe we could continue the discussion here?
This issue has been marked as stale because it has been open for 30 days with no activity. If the issue is still relevant then please leave a comment, or else it will be closed in 7 days.
This issue has been closed because it has been stale for 7 days. If it is still relevant, please re-open it.