[Chris Angelico]
Almost. Except for the problem that "disgusting" is a subjective term.

Yes. Thank you for explaining the joke.

 [Brice Parent]
I don't believe we need spam.eggs.cheese.aardvark? (there is exactly the same number of use cases). We win a bit in readability as it's closer to most spoken languages, but we lose in granularity as we're hiding any error that would raise if spam.eggs returned None, so it's not a full win on this side either...

First, I mostly proposed that alternative to serve my argument that there may be a better syntax that PEP 505 would make impossible down the road. It's a half-baked proposal at best and I agree with your over-all sentiment that it's probably not something we should consider either. That being said; in the normal usage of '?.' and '?[]' it would make little sense to only check the beginning of the expression:

spam?.eggs.cheese.aardvark  # why would you ever do this?

It makes some sense to do this:

spam.eggs.cheese?.aardvark

But in my proposal, you could force any part of the expression to evaluate before the '?' with parentheses and expose whatever errors that might throw:

(spam.eggs.cheese).aardvark?

On Sun, Jul 29, 2018 at 7:15 AM, Chris Angelico <rosuav@gmail.com> wrote:
On Sun, Jul 29, 2018 at 8:32 PM, David Mertz <mertz@gnosis.cx> wrote:
> I can hardly imagine a stronger bug magnet than PEP 505.

The hyperbole in this thread is impressive. Not just "I can hardly
imagine anyone PROPOSING a stronger bug magnet". You cannot imagine
one even existing.

And this is after people have proposed that "if x = 1:" become the
spelling for assignment expressions - something so well known as a bug
magnet that C compilers specifically warn against it, and style guides
recommend always writing "if (1 == x)" instead. Claiming that "?." is
*the worst possible bug magnet* rather weakens your credibility here.

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