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

[pythoncall] jl.Pair generates tuple instead of Julia pair #313

Open
hongyehu opened this issue May 24, 2023 · 3 comments
Open

[pythoncall] jl.Pair generates tuple instead of Julia pair #313

hongyehu opened this issue May 24, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@hongyehu
Copy link

Affects: JuliaCall

Describe the bug
In python, with
from juliacall import Main as jl
jl.Pair(1,2)
it will generate a tuple instead of julia pair like 1=>2.

system info
Please provide detailed information about your system:

  • Mac Ventura 13.2.1
  • The version of Julia 1.8.5, Python 3.9.7, JuliaCall 0.9.12
@hongyehu hongyehu added the bug Something isn't working label May 24, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented May 25, 2023

This isn't a bug, it's a feature: whenever you call a Julia function from Python, the inputs and outputs are converted according to the documented rules.

The next major version is likely to change this however, so that the outputs are not converted and are always returned as a wrapped Julia value, so the above code does what you expect.

For now, you can do jl.Pair._jl_raw()(1, 2)._jl_any().

Or pair = jl.seval("pyjl(Pair(1, 2))"); pair(1, 2).

@github-actions
Copy link
Contributor

This issue has been marked as stale because it has been open for 60 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 Aug 19, 2023
@github-actions
Copy link
Contributor

This issue has been closed because it has been stale for 7 days. You can re-open it if it is still relevant.

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

No branches or pull requests

2 participants