On 1/13/2021 8:56 PM, Greg Ewing wrote:
I say 'yes', because the purpose of logging is to document what happens, and if nothing happens, there is nothing to document. Wrapping a .__bool__ in a logging decorator might be part of testing it.On 14/01/21 1:13 pm, Paul Sokolovsky wrote:But nobody talked about optimizing away generic "pure"-annotated functions (which would differ from "mathematical" definition of purity), only about optimizing "pure" *dunder* methodsThe same thing applies. If we decide that print() is pure, then a __bool__ that calls print() is also pure, so there's nothing wrong with optimising it away, right?
-- Terry Jan Reedy _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/NRJT2YZ2U73ZYFZPAKKPXFBKGLJMBG3M/ Code of Conduct: http://python.org/psf/codeofconduct/