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

MRAB python at mrabarnett.plus.com
Fri Aug 12 23:31:19 EDT 2016


On 2016-08-13 00:48, David Mertz wrote:
> On Fri, Aug 12, 2016 at 4:25 PM, Victor Stinner
> <victor.stinner at gmail.com <mailto:victor.stinner at gmail.com>> wrote:
>
[snip]
>
> Also, what is the calling syntax? Are the arguments strictly positional,
> or do they have keywords? What are those default values if the arguments
> are not specified for either or both of min_val/max_val?  E.g., is this OK:
>
>     clamp(5, min_val=0)
>
I would've thought that the obvious default would be None, meaning 
"missing".



More information about the Python-ideas mailing list