Stepan Sindelar

Results 116 comments of Stepan Sindelar

Idea for new/better approach: Example usage: ``` HPyDef_STATE_METH(myabs, "myabs", module_state_t, HPyFunc_NOARGS) HPy myabs_impl(HPyContext *ctx, module_state_t *state, HPy self) { ... } // Slots: HPyDef_STATE_SLOT(myadd, module_state_t, HPy_nb_add) HPy myadd_impl(HPyContext *ctx, module_state_t...

Taking the inspiration from JNI (https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html), I have a new proposal: new structure with pointer to function to get the current context, e.g. `HPyVM`. One will be able to get...

> We probably need to define more clearly when a context can re-used. The idea was that you never "reuse" context. The context returned from `HPyVM_OpenContext` should be short-lived and...

### Summary of the suggestions so far: 1) Simple to use and implement, but dangerous and introduces link time dependency (mentioning it here just for completeness): ``` HPyContext *ctx =...

As a first step, we have moved the Gradle plugin, Maven plugin, GraalPy embedding utilities, Maven archetype, and the JBang integration into a separate repository: https://github.com/oracle/graalpy-extensions. For the next GraalVM/GraalPy...

Hello @sschuberth, thank you for your suggestion. This indeed looks neat. We'll consider this for the 25.0.0 release planned for September 16, 2025.

@hodgestar brought to my attention that this is already the contract of `tp_iternext` (https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_iternext): > When the iterator is exhausted, it must return NULL; a StopIteration exception may or **may...

As long as the exception is never thrown at runtime, i.e., you check the terminating condition yourself preemptively without raising and catching the exception, it should be fine.

Fundamentally no JIT can "see though" a native code of an extension, so it cannot optimize it and it cannot inline such code into the surrounding Python code to optimized...

The iteration goes all the way until it is outside of the range and then it stops. (maybe there is already some way to implement iterations without exceptions on the...