The proto here swallow and short circuit on attribute error. Changing to do it
on Noneness is easy, and you can choose between the two behavior: it's a
strength compared to the operator approach.
It's working in current python, another strength.
I think short-circuit behavior is similar: once stopping condition has been
met, the gard object cascade till the end of the nested attribute lookup. Like
None do for the operator.
More complex stuff when None-coalescing attribute access is mixed with normal
access is better done with operators.
Maybe complex operations fine of the middle of the access chain would also be
easier with the operators.
How many times would you encounter that in real cases? I bet on very few.
In those few case, would a one line ?. chain expression be better than a
multiple line logic with temporaries? I think no.
That's my feeling, but in the absence of concrete examples, feelings are ok.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/