JuliaPy / JuliaPy/PyCall.jl

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

Ouverte
#348 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Julia
Étoiles
1.5k
Forks
186
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
julia, python
Domaine
backend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.