Open
Description
Pygame has a C API, though it is undocumented, incomplete, and inconsistent. Since the API is only used internally—no external package depends on it—then it should be safe to alter. Cleaning up and filling out the C API, as well as properly documenting it, will help in maintenance of and extension to the package. Here are suggests:
- Replace struct GAME_Rect with the SDL_Rect equivalent.
- Decide on a Pygame specific prefix and use it for all API functions and types. Use of Py for anything other than the actual CPython C API is discouraged so remove from Pygame identifiers
- Replace the API import C macro with something that evaluates to -1 for a Python error. This will make API imports a little cleaner in an extension module's init routine.
- Document the API as new section of the Pygame docs.