support multiple return values using slice?
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 136
- Avg merge
- 14m
- Merged PRs (30d)
- 2
Description
It should be possible in theory to support multiple return values from Go functions, constructing a []handle slice or something like that. The main problem would be supporting any kind of mix of basic value types (int, float etc) and objects requiring handles -- we don't have handles for values.. And, not sure about how pybindgen works with these -- it is targeted toward C / C++ which doesn't support multiple return types, so presumably it just ends up being a single opaque slice object return value, and it is up to the python user to decode the values properly.
Probably it would make the most sense to only support homogenous basic return values -- multiple int's floats etc. This is likely to be a very small subset of functions -- so far I have just written a few *Py methods that do this manually.
Note that the common case of an additional error return value is handled using a Python exception, instead of returning the error, so this would continue in any case.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing manually written *Py methods that return multiple values and how Go functions are exposed through pybindgen. Define the supported homogeneous basic-value cases and how completion will be verified for ordinary values, handles, and the existing exception-based error return convention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100