[Python-ideas] PEP 505: None-aware operators

Chris Angelico rosuav at gmail.com
Wed Aug 1 03:43:21 EDT 2018


On Wed, Aug 1, 2018 at 5:40 PM, Jonathan Fine <jfine2358 at gmail.com> wrote:
> Hi Chris
>
> Thank you for your prompt reply. You wrote
>
>> Incorrect. The short-circuiting behaviour ends at any sort of
>> grouping. It's like how "a < b < c" is not equivalent to "(a < b) <
>> c", nor to "a < (b < c)".
>
> You've told me that my answer B is wrong. But you've not provided your
> correct answer. I'd be most grateful if you could tell me what are the
> equivalences between the 12 expressions I provided.

Oh. The equivalent ones are #1 and #2, and #7 and #8, where this
proposal doesn't change anything. Otherwise, they're not equivalent.

(And you can test #1 and #2 with dis.dis().)

ChrisA


More information about the Python-ideas mailing list