[Python-ideas] PEP 505: None-aware operators
Jonathan Fine
jfine2358 at gmail.com
Wed Aug 1 04:45:37 EDT 2018
Hi Chris
Thank you for your reply. I think we're making good progress.
You wrote
>> 10) a ?. b ?. c
>> 11) (a ?. b) ?. c
>
> I would parse those differently, but you may be right that they'll
> always have the same final result.
I'd like to get some certainty on this. I'm not aware of any value of
'a' for which #10 and #11 give different values. Can you (or anyone
else) think of any such value?
> Technically they should result in different code, though.
Maybe. We need to think. Should can be a difficult word. Elsewhere you
have, as I recall, pointed out that
if None:
do_something()
generates no code.
Perhaps the compiler should collapse #11 to #10, if they are
equivalent. But this is a side issue.
So, are there any values of 'a' for which #10 and #11 don't give the
same result?
--
Jonathan
More information about the Python-ideas
mailing list