JuliaPy / JuliaPy/PyCall.jl

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

Aperta
#348 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Julia
Stelle
1.5k
Fork
186
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reviewing how the py"""...""" input is compiled through Py_CompileString, and read the discussion in #255 alongside IPython's multi-line evaluation behavior. The work is complete when multi-line input returns the result of its last expression rather than nothing, with coverage for that behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
julia, python
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.