[Python-ideas] PEP 505: None-aware operators
David Mertz
mertz at gnosis.cx
Tue Jul 31 14:14:19 EDT 2018
On Tue, Jul 31, 2018, 1:47 PM Steven D'Aprano <steve at pearwood.info> wrote:
> Yes it is. Rhodri is correct, although I admit that I hadn't realised
> this point myself until he pointed it out. (That is why until now I've
> been writing examples like "spam?.eggs?.cheese?.aardvark" which is
> redundant.)
>
Again, one of the most vocal advocates of the PEP gets the semantics wrong!
`spam?.eggs?.cheese?.aardvark` is NOT redundant for `
spam?.eggs.cheese.aardvark`. The two expressions simply do different
things, but in a way guaranteed to assure that also everyone gets the
actual behaviors wrong.
Hint, run this before each expression:
spam.eggs.cheese = None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180731/8ba8190b/attachment.html>
More information about the Python-ideas
mailing list