JuliaPy / JuliaPy/pyjulia

Possible spurious FutureWarning

Open
#497 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
893
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Please consider this code:

```python
from julia import Julia

jl = Julia()
jl.eval("1 + 1")
#> [...]/.pyenv/versions/3.9.10/lib/python3.9/site-packages/julia/core.py:703: FutureWarning: Accessing `Julia().` to obtain Julia objects is deprecated. Use `from julia import Main; Main.` or `jl = Julia(); jl.eval('')`.
#> warnings.warn(
#> 2
```

I don't understand why there's an error here since I'm in fact using one of the recommended options from the warning above.

Using the first option works fine however:

```python
from julia import Main

Main.eval("1 + 1")
#> 2
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.