Skip to content

generic numpy.ufunc #88

Closed

Description

@jorenham

Currently, all ufuncs are basically untyped, accepting everything and returning Any. The numpy._typing._ufunc type-check-only "subtypes" are hacks that somewhat ease the pain. But a better solution is needed, and numpy._typing._ufunc should be removed entirely.

In NumPy, the .nin in {1, 2}, and .nout <= {1, 2}. But in SciPy (scipy.special) has .nin in {1, 2, 3, 4, 5} (some private ones have 7) and .nout in {1, 2, 4}. So the numpy.ufunc type should be flexible enough to allow nin>2 and nout>2. See scipy/scipy-stubs#27 for details on the scipy.special ufuncs.

Activity

  1. changed the title [-]Generic `numpy.ufunc`[/-] [+]generic `numpy.ufunc`[/+] on Feb 7, 2025
  2. self-assigned this
    on Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions