-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add HPyIter_(Check|Next) and HPy_GetIter #476
Add HPyIter_(Check|Next) and HPy_GetIter #476
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This is looking great so far. What are the parts you'd still like to add?
It would be nice to add documentation for the three new functions to public_api.h
if you have the time.
Well, something I'm not sure about is scope for this PR. Is this enough on its own, or would make sense to uncomment As for function docstrings, sure. I'll add those, using the surrounding ones as reference. |
It's definitely enough by itself, and small PRs are nice if one can have them. Regarding the other parts:
|
- Move functions to be consistent with reference file comments (i.e. `abstract.h`). - Additionally, add a bit more body to the HPyIter_Next test method.
Okay, that makes sense. I think that if I contribute anything more for the iterator-related API, it'll be in another PR. I've added docstrings and moved the functions to have more consistent placement within public_api.h (based on the comments referencing CPython files where the counterparts exist). Anything else needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
lgtm. I cannot think about any implementation issues this would cause on GraalPy side or in general. Let's give it a day in case anyone else wants to comment and I'd merge this PR. Thanks @Sachaa-Thanasius for the contribution! |
- This can be added later.
I was giving HPy a try and got confused on how to validate an iterable as a function input. Figured this would be one way to validate such an object and cycle through its members. The tests I added feel rough and I haven't added any docs yet (excluding anything autogenerated); regardless, any feedback would be appreciated.