"Skip Montanaro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]Unfortunately this will set value to True for all non-None values of d['x']. Suppose d['x'] == 3:
value = d.get('x') or bsf()
Of course, this bsf() will get called if d['x'] evaluates to false, not just
None,
value = (d.get('x') is not None) or bsf() #??
>>> 3 is not None True >>>
regards Steve
-- http://mail.python.org/mailman/listinfo/python-list