Just to add. I haven’t thought about evaluation. Thus, to prevent evaluation of unnecessary code, introduction of C-style expression is needed anyways:Well, default is only evaluated if needed; bar is always evaluated.1. result = bar is None ? default : bar
The below would have to evaluate all arguments, thus not achieving benefits of PEP505.2. result = ifelse(bar is None, default, bar)
So I would vote for something similar to:result = bar is None ? default : bar
Where default and bar is only evaluated if needed. Although not to the extent as initially intended, it would offer satisfiable solutions to several proposals.