[Python-Dev] (name := expression) doesn't fit the narrative of PEP 20 (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 26 02:00:07 EDT 2018
- Previous message (by thread): [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20
- Next message (by thread): [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tim Peters wrote:
To my eyes, this is genuinely harder to follow, despite its relative brevity:
while total != (total := total + term):
Not surprising, since there are at least two deeper levels of subtlety at play:
total isn't just naming a subexpression, it's being rebound to something that depends on its previous value.
Order of evaluation is being relied on to ensure that the new value of total is compared to its old value.
-- Greg
- Previous message (by thread): [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20
- Next message (by thread): [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]