Fwd: PEP 505: None-aware operators
22 Jul
2018
22 Jul
'18
11:09 a.m.
Aargh, I hate Google Groups with a vengeance. If people *have* to post from there, can they please change reply-to so that replies don't get messed up. Or is that not possible, and yet another way that GG is just broken? Paul ---------- Forwarded message ---------- From: Paul Moore
Except that the third possibility is not possible...if a is None, a[2] will throw an exception... For now at least ;-)
Doh. True, I should have said "If a is not None and a[2] is not None, use a[2]". But my point about unintended behaviour if a[2] is None stands. And the wider point that these operators are hard to reason correctly about is probably emphasised by my mistake. Paul
2104
Age (days ago)
2104
Last active (days ago)
0 comments
1 participants
participants (1)
-
Paul Moore