On Thu, Feb 13, 2020 at 1:50 AM Ethan Furman <et...@stoneleaf.us> wrote: > > On 02/11/2020 01:49 PM, Steven D'Aprano wrote: > > > Oh, definitely for the best. This now allows us to write complex > > assertions much more easily and efficiently: > > > > assert log(flag := complex_expression) or flag > > That doesn't seem very useful: for that assert to fail, `flag` would have to > be falsey, and if falsey, then surely the log of it is not helpful? >
Maybe the logging is meant to be useful when the flag is truthy. If the assertion fails, it's an immediate error, but if it passes, you get an informational log that might help interpret future messages? 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/CH25Q7TJ7MSJH2A6O7GNIYA6KXDSPEPJ/ Code of Conduct: http://python.org/psf/codeofconduct/