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()
Archives for the Date February 21st, 2008
Learning Python: Chapter 15
Thursday, 21 February 2008
Seven Languages in Seven Weeks
I Am a Strange Loop
A Short History of Nearly Everything