11 Sep
2016
11 Sep
'16
2:36 a.m.
On Sat, Sep 10, 2016, at 19:38, David Mertz wrote:
x2 = x?.foo
x3 = x?.bar?.baz?[x2]
A. if you're doing three different things with x, why are you using this instead of wrapping it in an if statement? B. Under some of the proposals, unless x.bar might be None independently of x not being None, this would just be "x?.bar.baz[x2]
x4 = x?(x?.val)
C. Under some of the proposals, the inner contents of the call brackets aren't evaluated if x is None, so you don't need to use x?.val here.
result = x3?(x4)