JuliaPy / JuliaPy/PythonCall.jl

Converting objects; e.g. support dataclasses?

Aperta
#567 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Julia
Stelle
1.1k
Fork
86
Merge medio
1g 22h
PR unite (30g)
3

Descrizione

I think, though not sure, that dataclasses are very important in (modern) Python (supported in all current Python, i.e. since 3.7), and they basically map to Julia's structs (or well could), so do they need special support in this project? I don't see them in the table:

https://github.com/JuliaPy/PythonCall.jl/blob/a61c0223a60b803016e51a0dde39371222abf773/docs/src/conversion-to-julia.md?plain=1#L25-L40

I do see Python also has namedtuples, an alternative, not clear to me if either supported. I see tuples are, and something gets converted to Julia's NamedTuples. And PyDict. Python dictionaries are ordered, so I think PyDict supports that (converting from; and to Python likely also not problematic), otherwise mapping to Dict, simply would have been chosen?

[I see Python has now an *internal* C API (not public API) to get UTF-8 data, so maybe something better could be done for passing strings back end forth.]

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with docs/src/conversion-to-julia.md, especially the conversion table around lines 25-40, and inspect how tuples, NamedTuples, and PyDict are handled. Determine whether Python dataclasses and namedtuples are supported or need explicit conversion behavior, with the resulting support or documentation making the conversion rules clear.

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

Valutazione

Stack tecnologico
julia, python
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.