go-python / go-python/gopy

When calling a Go function that returns multiple values that aren't errors, store it in a tuple

未关闭
#317 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
2.3k
派生
136
平均合并
14 分钟
30 天内合并 PR
2

描述

Because I was trying to wrap github.com/faiface/beep/vorbis so I can play audio, but the only useful function in that package returns (Streamer, Format, err), and because it returns too many values, Gopy refuses to add it in and I am seemingly stuck.
There should be no problem simply returning a tuple. There are also some methods that return multiple values none of which are errors. If Gopy finds a function that returns an error but doesn't do so using the last return value, it should throw a compile error, but I've never seen one of those.

贡献指南

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

调研方向

首先跟踪 gopy 如何处理 Go 函数的返回值并生成相应的 Python 包装器,然后使用 github.com/faiface/beep/vorbis 重现该问题。完成标准是:多个非错误返回值以元组形式暴露,而 error 返回值不在最后的函数会产生编译错误。

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

评估

技术栈
go, python
领域
tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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