On Sat, Oct 25, 2014 at 5:58 AM, Ned Batchelder <n...@nedbatchelder.com> wrote:
> You mention "standard Python idioms."  I think this style of
> conditional-via-indexing is becoming quite uncommon, and is no longer one of
> the standard Python idioms.  This is now in the category of "outdated hack."

I think that's probably true. And even in code written for versions of
Python than predate the ternary, I think I've seen the idiom "(cond
and [if_true] or [if_false])[0]" more often than the one being
discussed -- perhaps because it more closely resembles the format of
the C ternary
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to