Lluís <llpam...@pamies.cat> added the comment:

David, the problem is that if you have the logging inside a loop, the 
interpreter will have to evaluate the condition every time. With an assert you 
guarantee that *no code* is executed.

I know that we can find thousands of ways to do that, even writing a dynamic 
proxy for the Logger, and wrap the debug(), error() calls and return True, etc.

My is not telling developers to write "assert logger.debug('aa')" every time 
that they want to log something, but instead giving them the option to do that 
and be sure that *no code* is executed. Specially, because the return value of 
log functions is not used at all.

Thanks for the responses.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14868>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to