[Python-ideas] Consider adding clip or clamp function to math

Serhiy Storchaka storchaka at gmail.com
Mon Aug 1 04:20:30 EDT 2016


On 31.07.16 22:38, Victor Stinner wrote:
> I dislike this API. What's the point of calling clamp(x)? clamp(b, a) is
> min(a, b) and clamp(a, max_val=b) is just max(a, b). My point is that
> all  parameters must be mandatory.

Seconded.




More information about the Python-ideas mailing list