title: python equivalent of '#define func() ' or how to comment out a function call in python
body: <p>my python code is interlaced with lots of function calls used for (debugging|profiling|tracing etc.)
  for example:</p>
  
  <pre><code>import logging
  
  logging.root.setLevel(logging.DEBUG)
  logging.debug('hello')
  j = 0
  for i in range(10):
      j += i
      logging.debug('i %d j %d' % (i,j))
  print(j)
  logging.debug('bye')
  </code></pre>
  
  <p>i want to #define these resource consuming functions out of the code. something like the c equivalent</p>
  
  <pre><code>#define logging.debug(val)
  </code></pre>
  
  <p>yes, i know the logging module logging level mechanism can be used to mask out loggings below set log level.  but, im asking for a general way to have the python interpreter skip functions (that take time to run even if they dont do much)</p>
  
  <p>one idea is to redefine the functions i want to comment out into empty functions:</p>
  
  <pre><code>def lazy(*args): pass
  logging.debug = lazy
  </code></pre>
  
  <p>the above idea still calls a function, and may create a myriad of other problems</p>