Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pyconvert(x) #172

Open
CarloLucibello opened this issue May 14, 2022 · 6 comments
Open

add pyconvert(x) #172

CarloLucibello opened this issue May 14, 2022 · 6 comments

Comments

@CarloLucibello
Copy link
Contributor

For convenience, it would be nice to expose

pyconvert(x) = pyconvert(Any, x)
@cjdoris
Copy link
Collaborator

cjdoris commented May 21, 2022

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.

@CarloLucibello
Copy link
Contributor Author

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

@cjdoris
Copy link
Collaborator

cjdoris commented May 28, 2022

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.).

@hhaensel
Copy link

I just added my two cents to the pyconvertnative() discussion, see #128

Maybe we could continue the discussion here?

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues about to be auto-closed label Sep 10, 2023
@github-actions
Copy link
Contributor

This issue has been closed because it has been stale for 7 days. If it is still relevant, please re-open it.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
@cjdoris cjdoris reopened this Sep 22, 2023
@cjdoris cjdoris removed the stale Issues about to be auto-closed label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants