Re: if not DEBUG: log = null_log

2005-07-12 Thread @(none)
is: >> >>def log(*args): print args >>def null_log(*args): pass >>if not DEBUG: log = null_log >> >>is unacceptable because of the overhead of calling >>functions in python. >> > > I think you could make the existence of log calls dependent on >

Re: if not DEBUG: log = null_log

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton <[EMAIL PROTECTED]> wrote: > >Hi, > >I'm after a no-op command, so that i can redirect >logging commands in performance critical code. > >Something like this: > >def log(*args): print args >def null_log(*

Re: if not DEBUG: log = null_log

2005-07-12 Thread Steven D'Aprano
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton wrote: > Hi, > > I'm after a no-op command, so that i can redirect > logging commands in performance critical code. > > Something like this: > > def log(*args): print args > def null_log(*args): pass > i

if not DEBUG: log = null_log

2005-07-12 Thread Simon Burton
Hi, I'm after a no-op command, so that i can redirect logging commands in performance critical code. Something like this: def log(*args): print args def null_log(*args): pass if not DEBUG: log = null_log is unacceptable because of the overhead of calling functions in python. log (&quo