10 Sep
2016
10 Sep
'16
7:38 p.m.
On Sat, Sep 10, 2016, at 20:15, David Mertz wrote:
On Sep 10, 2016 4:45 PM, "Guido van Rossum"
wrote: There seems to be a major misunderstanding here. A None-coalescing operator is not for catching AttributeError, it's a shortcut similar to "a or b" except that it checks for "a is None" rather than bool(a).
To put it more explicitly, more similar to "a and a.b"
This really MUST BE essentially a way a catching AttributeErrors though. With the proposed syntax 'x?.foo?.bar' will resolve even if x has no 'foo'.
Why? I think you're confusing this proposal for something else. This is for treating x is None specially, not simply catching AttributeError to deal with the fact that None.foo doesn't exist.