On 05/07/2020 05:39, Steven D'Aprano wrote:
On Sun, Jul 05, 2020 at 12:18:54PM +0900, Stephen J. Turnbull wrote:
> and I'd like to toss a possible `coerce`
Here my issue is that for me the *target* of a coercion should be a
"single thing", which could be a type, but might also be a scalar. ...
No, I agree. In computing, coerce nearly always means to coerce to a
type, not to coerce to some range of values.
"bound", or probably "bounded" (for the same reason we have "sorted").
"clamp" and "clip" sound to me like things you do to a waveform (with
Schottky diodes!), so it works for me but I'm not sure it travels well.
Elsewhere in the thread (tree) we're already calling arg[1:2] "bounds",
so reading this as "the value of x bound[ed] by the range -1 to +5"
seems natural.
Or "limited" possibly?
I'm +0 on the idea FWIW. I also find it difficult to read, but I tend to
in-line it as ifs, in part for clarity.
Jeff Allen
_______________________________________________
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/T7HC7CNOZAHZHLKB36OR3772MAICWIUG/
Code of Conduct: http://python.org/psf/codeofconduct/