On Mon, Dec 2, 2024 at 12:15 AM George Harker <george@xxxxxxxxxxxxxxxxxxxxx> wrote: > > PyDict_Next does not guarantee pos is contiguous, and pypy increments > past the end of the dict size. Patch fixes reliance on pos for constructing > args for gpiod call. > > As per discussion here https://github.com/pypy/pypy/issues/5142 > Ah, it's right there in the documentation too[1]: "Its value represents offsets within the internal dictionary structure, and since the structure is sparse, the offsets are not consecutive." Thanks for the catch. I wasn't aware pypy actually reimplements the entire C API of cpython. How would I go about building libgpiod python bindings with pypy? Bart [1] https://docs.python.org/3/c-api/dict.html#c.PyDict_Next