On Fri, Aug 26, 2011 at 6:54 AM,  <t...@thsu.org> wrote:
> def doSomething(debug=None):
>  debug = coalesce(debug,defaults['debug'])
>  # blah blah blah
>

It won't work with a True/False flag, but if you can guarantee that
all real options will evaluate as True, you can use a simpler
notation:

def doSomething(option=None):
  option=option or defaults['option']

You can't explicitly set option to False/0 with this, but it is a bit
cleaner (IMO - some may disagree).

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to