[Python-Dev] PEP 572: Assignment Expressions (original) (raw)
Matěj Cepl mcepl at cepl.eu
Sat Apr 21 13:53:42 EDT 2018
- Previous message (by thread): [Python-Dev] PEP 572: Assignment Expressions
- Next message (by thread): [Python-Dev] PEP 572: Assignment Expressions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2018-04-21, 07:46 GMT, Chris Angelico wrote:
doubleditems = [x for x in (items := getitems()) if x * 2 in items]
Aside from other concerns expressed elsewhere by other people, do you really like this? I know and agree that “readability” is a subjective term, but it is my firm persuasion that whenever I need to think about what particular list comprehension means, it is the moment I should write a separate function or normal cycle. I think we should encourage writing simple (I didn’t use the r* word here, you see!) code than something which has potential to slide us towards Perl.
Best,
Matěj
https://matej.ceplovi.cz/blog/, Jabber: mcepl at ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
A day without sunshine is like night.
- Previous message (by thread): [Python-Dev] PEP 572: Assignment Expressions
- Next message (by thread): [Python-Dev] PEP 572: Assignment Expressions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]