I just stumble upon on this precise use case yesterday, I solved it unsatisfactorily by the following code (inlined)
value = max(lower, value) value = min(upper, value) So It's certainly a good thing to have
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/