![](https://secure.gravatar.com/avatar/176220408ba450411279916772c36066.jpg?s=120&d=mm&r=g)
On Mon, Jul 6, 2020 at 11:28 AM Chris Angelico <rosuav@gmail.com> wrote:
On Tue, Jul 7, 2020 at 3:49 AM Christopher Barker <pythonchb@gmail.com> wrote:
[*] Honestly, while you *could* use clamp() with any comparable objects,
I really don't see a use case for anything non-numerical, but why not?
Depends how broadly you define "numerical". Is a datetime numerical?
Good catch -- clearly a failure of my imagination :-) I think that's a great example of why it's useful for the function to be generic -- better example than strings, for sure :-) -CHB It's a reasonable thing to clamp, and in a sense, can be thought of as
a number (eg Unix time). But it's certainly not part of the numeric tower. I'd say it's best to let clamp work with anything comparable, and let people figure for themselves what makes sense.
ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/IOIL2K... Code of Conduct: http://python.org/psf/codeofconduct/
-- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython