Sorry, that got sent too soon. On Sun, Jul 5, 2020 at 1:59 PM Christopher Barker <python...@gmail.com> wrote:
> On Sun, Jul 5, 2020 at 6:15 AM MRAB <pyt...@mrabarnett.plus.com> wrote: > >> > clamp(value: Number, minimum: Union[Number, Iterable[Number]], maximum: >> Union[Number, Iterable[Number]]) >> > > > What would that return? What if the iterables were two different > lengths? > > If anything, I would accept an iterable for the value, and return an > iterator. > > min() with an iterable is essentially a reduce. clamp() with an iterable > would be a map. > Though then there is the question of what to return for a scalar value: an iterator with one value or a scalar? So maybe these kinds of operations should be left to numpy. -CHB
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/NC334DSLOP72P5EABIEVNPLXIBLZWU7A/ Code of Conduct: http://python.org/psf/codeofconduct/