On Mon, Jul 6, 2020 at 11:28 AM Chris Angelico <ros...@gmail.com> wrote:
> On Tue, Jul 7, 2020 at 3:49 AM Christopher Barker <python...@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-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/IOIL2KKKLPQ5RJA2U6N5NYY7WY2ADWFC/ > 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
_______________________________________________ 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/O7FWPT3LMR2QQDYKMTZNZWO5FAVA4BHT/ Code of Conduct: http://python.org/psf/codeofconduct/