Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Heated discussion on python-dev regarding proposed PEP 572
2 points by 21 on May 1, 2018 | hide | past | favorite | 1 comment
A lot of drama regarding a new syntax proposal (which I fell is terrible) which allows assignment in expressions:

while (value := read_next_item()) is not None:

assert 0 == (x := (y := (z := 0)))

stuff = [[y := f(x), x/y] for x in range(5)]



Link?

In principle, I like it. But I don't think it's worth the cost of making the change. Python is accumulating a lot of stuff you have to know but that isn't that valuable. Don't want it to end up like C++.

Also, the second and third examples wouldn't be idiomatic, and I believe there's already a better way to write the first.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: