
Sept. 10, 2016
5:44 p.m.
On 10 September 2016 at 18:26, Guido van Rossum <guido@python.org> wrote:
IMO the key syntax is simply one for accessing attributes returning None instead of raising AttributeError, so that e.g. `foo?.bar?.baz` is roughly equivalent to `foo.bar.baz if (foo is not None and foo.bar is not None) else None`, except evaluating foo and foo.bar only once.
If we're not looking to use all the other null-coalescing variants (?=, ?(), ...) - which is something I'm pleased about, as I do think that scattering that many ?'s about is likely to lead to ugly code - then it would probably be fine to just use ? for this operation, so we'd have foo?bar?baz rather than needing foo?.bar?.baz. Paul