[Python-Dev] PEP 572: Assignment Expressions (original) (raw)
Tim Peters tim.peters at gmail.com
Tue Apr 24 02:55:13 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 ]
[Antoine]
- does it make Python easier to learn and teach?
[Tim]
By whom? Almost no addition has ever made a language easier to learn for raw beginners: every addition is something they eventually need to learn. We could make Python easier to learn for beginners by throwing out virtually everything added since version 0.9.6 ;-)
[Antoine]
Constructs like "with ..." or "try / except / finally" make the language easier to learn compared to the dances they are meant to replace.
They nevertheless need to be taught & learned (and try/except/finally was essentially always in the language), You snipped the parts pointing out that binding expressions are already familiar to people coming from most other languages, and even for raw beginners the semantics are the tiniest part of what they need to learn anyway about Python's assignment expressions.
So that was my point: they don't make Python any harder to learn or teach. To the contrary, for people coming from other languages, it's one less thing they're used to they wouldn't have to _un_learn.
"await" is a more readable and less confusing improvement over "yield from".
Heh. Not to me. I have literally have no idea what to with "await" (I use generators heavily, but have had no use yet for coroutines), but use
yield from an_iterable
routinely. That use is perfectly clear, to the point that it can't be improved on: it already does exactly what I want from it, with no effort at all. It's simply impossible that, whatever "await" does, it could be more readable or less confusing than what I use "yield from" for.
Format strings dispense from the older, more convoluted formulations.
But they didn't replace them. They're Yet Another Way to Format Strings everyone has to learn. That made teaching/learning harder, not easier, but you can make a case they make Python easier to use for people who eschew the older forms.
Iteration is much simpler than the longer forms we would have to write if generalized iterators didn't exist.
I'll buy that one. Now go through the HISTORY file and count all the changes you didn't name ;-)
- 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 ]