Skip to content

MAINT/BUG? __array_ufunc__ should try a given type only once #11306

Closed
@mhvk

Description

@mhvk

In the discussion of __array_function__, it was noted that __array_ufunc__ is called on every operand (if present) even if an operand of the given type has already been called [1]. This seems rather senseless: if it didn't work the first time, it won't work the second time either; it may be worth checking this (though it doesn't actually cost anything in the common case that the first trial just works -- but it may speed up things a little).

[1] https://github.com/numpy/numpy/pull/11303/files#diff-95f51a69624c6765b1ddae13dc0616cbR212

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions