JuliaPy / JuliaPy/PythonCall.jl

Converting objects; e.g. support dataclasses?

未关闭
#567 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Julia
星标
1.1k
派生
86
平均合并
1 天 22 小时
30 天内合并 PR
3

描述

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.]

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
julia, python
领域
backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。