Nick Coghlan writes:

 > >     # Similar to the boolean 'or' but checking for None specifically
 > >     x = "default" if (eggs := spam().ham) is None else eggs
 > >
 > >     # Even complex expressions can be built up piece by piece
 > >     y = ((eggs := spam()), (cheese := eggs.method()), cheese[eggs])

My immediate take was "this syntax is too ugly to live", but so are
Gila monsters, and I don't understand the virtues that lead Nick and
Guido to take this thread seriously.  So I will just leave that
statement here.  (no vote yet)

More constructively, I found it amusing that the results were stuffed
into generic one-character variables, while the temporaries got actual
words, presumably standing in for mnemonic identifiers.  Besides
moving the examples, that should be fixed if these examples are to be
used at all.  I'm also with Paul (IIRC) who suggested formatting the
second example on multiple lines.

I suggest s/x/filling/ (sandwich) and s/y/omelet/.

Steve
_______________________________________________
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