JuliaPy / JuliaPy/PyCall.jl

return value of last expression from multi-line py"""..."""

Open
#348 2 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
1.5k
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Currenty,
```jl
py"""
....Python code
"""
```
returns nothing, because that is what [`Py_CompileString` does for `Py_file_input`](https://docs.python.org/2/c-api/veryhigh.html).

It would be nice to, instead, return the result of the last expression evaluated, similar to what IPython does when evaluating multi-line input. As discussed in #255, IPython does this by parsing the code and then evaluating one expression in the AST at a time, and in principle we could do the same thing.

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.