Re: [PATCH] libgpiod: bindings: python: Fix PyDict_Next contiguous assumption and pypy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux