Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Extend Python tuple support for more unusual type creations #26948

Open
lydia-duncan opened this issue Mar 19, 2025 · 0 comments

Comments

@lydia-duncan
Copy link
Member

Summary of Feature

Description:
It'd be nice to be able to specify you want a tuple when the Python function returns an array or yields back. Jade suggested that we might be able to get this to work if we rely on PySequence_GetItem or if we do a check for an iterator or generator. But we felt this shouldn't hold up #26946

Is this issue currently blocking your progress?
Nope, just seemed cool to support

Code Sample

(Not complete)

def foo():
  return [1, 2, 3]
def bar():
  yield 1
  yield 2

var t = foo(3*int); // for this to work, you need to do `PySequence_GetItem`
var t2 = bar(2*int); // for this to work, you need to check for a iterator/generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant