[Python-ideas] Dynamic code NOPing

anatoly techtonik techtonik at gmail.com
Tue Dec 25 07:28:18 CET 2012


For the logging module it will be extremely useful if Python included a way
to disactivate processing certain blocks to avoid making sacrifices between
extensive logging harness and performance. For example, instead of writing:

if log.DEBUG==True:
  log(factorial(2**15))

It should be possible to just write:
  log(factorial(2**15))

if if log() is an instance of some Nopable class, the statement in log's
braces is not executed.
-- 
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121225/95f8a923/attachment.html>


More information about the Python-ideas mailing list