On Thu, Apr 29, 2010 at 12:01 PM, Michel Claveau - MVP <enleverlesx_xx...@xmclavxeaux.com.invalid> wrote: > Hi! > >> print x or y or z >> If none of the potential values are considered boolean false > > But : > a=None > b=False > c=None > print a or b or c > > None
Consider: def read_default_from_config(cfg_file): #pseudocode if not_specified_in(cfg_file): return None return read_value_from(cfg_file) a = None b = read_default_from_config("1.cfg") c = read_default_from_config("2.cfg") print a or b or c Now, what happens when the user puts a default of 0 in 1.cfg? This was my intended point. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list