Skip to content

C API: Implement Py_MIN(), Py_MAX() and Py_ABS() macros using typeof() #157495

Description

@vstinner

Currently, arguments of Py_MIN(), Py_MAX() and Py_ABS() macros are evaluated twice. It's inefficient. We can do better using typeof(). I propose adding a typeof() implementation for these macros.

See also:

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-refactorCode refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions