easy verbose in functions

Pascal pascal.parent at free.fr
Mon Mar 29 04:50:03 EST 2004


Hello,

I've a function like this:
def myfunction(data, verbose = False):
   dothis...
   if verbose: print 'I do this'
   dothisother
   if verbose: print 'I do this other'
   ...

How can I do to exclude eachtime the `if verbose` statement?

I tried `print verbose and 'I do this'` but it's printing `False`.
So I tried with `verbose = None` in the definition, but it's printing None!

Thanks.



More information about the Python-list mailing list