Archives for the Date February 21st, 2008

Learning Python: Chapter 15

A function definition may be put inside an if-block.
if DEBUG:
  def do_something():
    print ‘useful debug information’
    do_some_work()
else:
  def do_something():
    do_some_work()