None seems reasonable. But it does require some conditional checks rather than the simplest min-of-max. Not a bad answer, just something to be explicit about.
On Aug 12, 2016 8:44 PM, "Chris Angelico" firstname.lastname@example.org wrote:
On Sat, Aug 13, 2016 at 1:31 PM, MRAB email@example.com wrote:
On 2016-08-13 00:48, David Mertz wrote:
On Fri, Aug 12, 2016 at 4:25 PM, Victor Stinner <firstname.lastname@example.org mailto:email@example.com> wrote:
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:
I would've thought that the obvious default would be None, meaning "missing".
Doesn't really matter what the defaults are. That call means "clamp with a minimum of 0 and no maximum". It's been completely omitted.
But yes, probably it would be min_val=None, max_val=None.
ChrisA _______________________________________________ Python-ideas mailing list Pythonfirstname.lastname@example.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/