JuliaPy / JuliaPy/PyCall.jl

bidirectional Symbol conversion

Offen
#11 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.