> On 14 Feb 2017, at 15:51, Barry Scott <ba...@barrys-emacs.org> wrote:
> And have the evaluation of the argument skipped unless its dbg_log is enabled.
> 
> I cannot see how to do this with python as it stands.
> 
> Something would have to be added to allow python to short circuit the 
> argument tuple evaluation.
> 
> Maybe python can check for a special dunder on the class that know how to do 
> this idiom, __if_true_call__?
> 

Is there any reason logger.isEnabledFor(level), as shown in the docs 
https://docs.python.org/2/library/logging.html#logging.Logger.isEnabledFor 
<https://docs.python.org/2/library/logging.html#logging.Logger.isEnabledFor>, 
is not sufficient for this?

Cory
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to