>While I don't disagree with some of your main points, I do think that  
>your proposal would eliminate a natural and easy to understand use of  
>the current behavior of "or" that I tend to use quite a bit.  Your  
>proposal would break a lot of code, and I can't think of a better  
>"conditional operator" than the one thats already there.
>
>I often find myself using 'or' to conditionally select a meaningful  
>value in the absence of a real value:

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)

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to