-
-
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
Added HPySlice_New #481
Added HPySlice_New #481
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.
LGTM so far. As you mentioned, please add tests. This should be very easy since this function only fails if the object cannot be allocated and we don't test for out of memory problems.
You should just test if HPy_NULL
is correctly handled if passed as start
, stop
, or step
.
test/test_hpyslice.py
Outdated
return HPy_NULL; | ||
} | ||
HPy length = HPySlice_New(ctx, start, stop, step); | ||
return length; |
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.
minor: this could just be return HPySlice_New(...)
hpy/tools/autogen/public_api.h
Outdated
* | ||
* :param start: | ||
* A pointer to a variable where to write the unpacked slice start. Must not | ||
* be ``NULL``. |
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.
I guess this is just a copy-and-paste-error but those parameters are not pointers.
I would write something like: "A handle to an object to be used as slice start" or something (your English is better than mine 🙂). Also, we allow HPy_NULL
!
(Same for the other params.)
Added HPySlice_New - still need to add tests. Needed for benchmarks for Cython.