JuliaPy / JuliaPy/PyCall.jl

bidirectional Symbol conversion

Ouverte
#11 1 commentaire 0 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

Currently, `PyObject(s::Symbol)` produces a Python string, and `convert(Symbol, o)` converts a Python string object back into a `Symbol`. However, automatic type conversion does not work, i.e. `convert(PyAny, PyObject(:Foo))` produces `"Foo"` not `:Foo`.

One way to fix this might be to define a new Python string subtype, and instantiate this type from `PyObject(s::Symbol)`. That way, it will be usable as a string in Python but `convert(PyAny, ...)` will be able to detect that it is "really" a symbol and convert it appropriately.

Guide de contribution

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

Piste de recherche

Start by tracing the PyObject(s::Symbol), convert(Symbol, o), and convert(PyAny, PyObject(:Foo)) paths described in the issue. Confirm that a Symbol remains identifiable during Python string use and that converting it back produces :Foo rather than a plain string.

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

Évaluation

Stack technique
julia, python
Domaine
api, backend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
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.