Skip to content

Avoid parsing a format string for each float or complex array item #162507

Backlog

Description

@maurycy

Feature or enhancement

When floats is a list, array('d', floats) calls d_setitem() for each element. The setter passes the same d format over and over to PyArg_Parse().

The setters can call PyFloat_AsDouble() directly for e, f, and d, and PyComplex_AsCComplex() for Zf and Zd.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    type-feature
    on Nov 23, 2026
  2. added
    extension-modules
    performance
    on Nov 23, 2026
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

    extension-modulesperformancetype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions