Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Generated Python code is not interoperable when a union contains a member called "value"

未关闭
#338 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #339 来自 @Miko997 —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
c, python

调研方向

首先,在 Python 和 C 的 hello-world 示例中使用提供的 QualifiedName IDL 重现该问题。比较 union 成员命名为 value 与命名为 the_value 时生成的代码和 wire 行为。当 publisher 和 reader 匹配并能使用未改变的 value 成功通信时,即表示完成。

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

描述

When using an IDL file which defines a union, which contains a member called "value" - the generated python code is no longer interoperable with other language implementations.

For example:

module AddressSpace {

    union QualifiedName switch (boolean) {
        case TRUE:
            string value;
    };

    struct Node {
        long node_id;
        QualifiedName browse_name;
        string display_name;
    };

};

I used this IDL as a replacement for the "hello world" examples in both the python and C repositories (C acting as the publisher, python as the subscriber). With the IDL file exactly as above, the publisher never matches with a reader. Simply changing the above IDL file to replace the "value" member with something else (say, for example "the_value"), and regenerating the C and python code - causes everything to work as expected.

I am also aware of the @optional IDL syntax - but unfortunately cannot use it in this case.

主要语言
Python
星标
110
派生
68
平均合并
3 天 5 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-cyclonedds/cyclonedds-python 的其他 Issue

查看 eclipse-cyclonedds/cyclonedds-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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