> 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) _______________________________________________ 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/ASOXQV7M4HS3WOR7PHUNRXQUE4WQHAPE/ Code of Conduct: http://python.org/psf/codeofconduct/