[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Documenting the pygame C API and making the API consistent





I know from experience how much more of a headache it is to build/distribute native extensions that depend on other native extensions' ABIs (numpy, specifically).

Do Pygame Surface/Sound objects support the Buffer Protocol? This would be a convenient way to to read and update object data without needing to compile against Pygame.
Pygame has better buffer support than Python 3.
To be clear, pygame Surfaces and Sound objects export their data with the New Buffer Protocol. The numpy specific surfarray and sndarray modules are wrappers for the buffer based pixelcopy module. At the time when I added New Buffer support to pygame, it was better developed than that provided by the Python 3 buffer object.

Lenard Lindstrom