10000 Refactoring Pygame C API · Issue #333 · pygame/pygame · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Refactoring Pygame C API #333
Open
Open
@llindstrom

Description

@llindstrom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C codeInvolves changing C codeCode quality/robustnessCode quality and resilience to changesdocsmoderateAn intermediate challenge to solve

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0