-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
search & findThe find* family of functionsThe find* family of functions
Description
findmin and findmax return a tuple with the index of the maximum/minimum, and the corresponding value. This behavior is kind of inconsistent with find, findfirst, findlast, findnext and findprev, which return indices without values. On the other hand, indmin and indmax return only the indices.
It would be more consistent to rename indmin/indmax to findmin/findmax. Of course this is not possible in a single deprecation cycle. I can see two solutions:
- Deprecate
findminandfindmaxin 0.7, and renameindminandindmaxtofindminandfindmaxin 1.0. This has the drawback of breaking things between 0.7 and 1.0. - Rename
indminandindmaxtofindminandfindmaxin 0.7. This introduces breaking changes in 0.7, but at least there wouldn't be any changes in 1.0.
Finally, it's not clear to me whether we really need the current behavior of findmin/findmax, compared with getting the index and then extracting the corresponding element manually. The performance gain should only be significant for very small collections AFAICT.
Metadata
Metadata
Assignees
Labels
search & findThe find* family of functionsThe find* family of functions