Skip to content

Make the ufunc loop signature const correct #15252

@eric-wieser

Description

@eric-wieser

Today, the ufunc loop signature (PyUFuncGenericFunction) is

ctypedef void (*PyUFuncGenericFunction) (char **, npy_intp *, npy_intp *, void *)

I would argue it should be (char **, npy_intp const *, npy_intp const*, void *), ie inner loops are not allowed to modify the shape or stride.

Changing this would force users to either:

  • Ignore compiler warnings
  • Add const to their loop signatures

Creating this issue now so that I can reference it internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    03 - Maintenance63 - C APIChanges or additions to the C API. Mailing list should usually be notified.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions