HI!
I'm using the idiom
a = a or b
to get rid of statements like
if a is None:
a = b
Now I wonder what happens if both a and b have zero-length values.
Trying in Python 2.2.1 reveals:
>>> repr(0 or None)
'None'
>>> repr(None or 0)
'0'
>>> repr('' or None)
'None'
>>> repr(None or '')
"''"
>>>
Is it guaranteed to work like this or should that be avoided?
Ciao, Michael.