On 2020-07-03 7:53 p.m., [email protected] wrote:
> I'd go for val[min:max] tbh.
> benefits:
>
> - currently not allowed!
> - replaces min and max!
Is this a serious suggestion? No offence intended, but this seems
ill-thought-out.
val[min:max] is perfectly legal syntax and it will only error if the variable
val happens to not support indexing. This seems like it would break numpy
arrays (which, IIRC, support both slicing and arithmetic operations), or, at
the very least, be ambiguous on classes which choose to support both indexing
and ordering (and thus clamping)
how do you plan to clamp a numpy array or a string?
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ASOXQV7M4HS3WOR7PHUNRXQUE4WQHAPE/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ZT3OBOPNIMXQ2MU7N5RFBL5AJSYRZJ6Q/
Code of Conduct: http://python.org/psf/codeofconduct/