Hi Chris

We're discussing.
> 10) a ?. b ?. c
> 11) (a ?. b) ?. c

I asked
> So, are there any values of 'a' for which #10 and #11 don't give the
> same result?

You replied
> I'm not prepared to put my neck out and say "They are absolutely
> identical" and have people jump on me with some technicality. What is
> your point here?

I am willing to put my neck out and say a.b.c and (a.b).c are
equivalent. And my understanding for PEP 505 is that #10 and #11 is
that they are equivalent.

You're right to be cautious. My understanding of PEP 505 is that
#13.  a ?. b ?. __str__
#14. (a ?. b) ?. __str__
are not equivalent. The first is None, and the other is None.__str__.
That looks like a gotcha.

(By the way, it was not my intention to catch you out. I'm simply
looking for clarity. I wasn't aware of the gotcha until I started
answering myself the question I had asked you.)

However, the None object is somewhat special, in that all it's methods
and double-under (dunder) methods. And one of them is __bool__.  And
we can't add or change the attributes of None.

Chris, you don't have to reply to this. But I would be pleased if an
expert could either tell me that my neck is safe, or produce a value
of 'a' that cuts it off (so to speak).

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to