PEP 0505 – None coalescing operators
python.org
python.org
The text gives an example of current code:
data = [] if data is None else data
then argues:> This particular formulation has the undesirable effect of putting the operands in an unintuitive order: the brain thinks, "use data if possible and use [] as a fallback," but the code puts the fallback _before_ the preferred value.
I tried, but I don't see this as unintuitive. I would like more than the proposer's intuition as justification. Eg, is there any evidence that developers or reviewers have a tendency to confuse these by accident?