[Python-Dev] "and" and "or" operators in Py3.0
Martin Blais
blais at furius.ca
Tue Sep 20 14:41:15 CEST 2005
More information about the Python-Dev mailing list
Tue Sep 20 14:41:15 CEST 2005
- Previous message: [Python-Dev] "and" and "or" operators in Py3.0
- Next message: [Python-Dev] "and" and "or" operators in Py3.0
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 9/19/05, Andrew McNamara <andrewm at object-craft.com.au> wrote: > > I agree. I find I often have an object with an optional friendly name > (label) and a manditory system name. So this sort of thing becomes common: > > '%s blah blah' % (foo.label or foo.name) > > The if-else-expression alternative works, but isn't quite as readable: > > '%s blah blah' % (foo.label ? foo.label : foo.name) Where does this work?
- Previous message: [Python-Dev] "and" and "or" operators in Py3.0
- Next message: [Python-Dev] "and" and "or" operators in Py3.0
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list