5 ms·
>Now that PEP 572 is done, I don't ever want to have to fight so hard for a PEP and find that so many people despise my decisions. PEP 572: Python assignment e
by password4321 8y ago
>Now that PEP 572 is done, I don't ever want to have to fight so hard for a
PEP and find that so many people despise my decisions.
PEP 572: Python assignment expressions has been accepted
https://news.ycombinator.com/item?id=17448439 https://news.ycombinator.com/item?id=17448439
- ehsankia 8y agoIs the final syntax := surrounded by parenthesis?
- skywhopper 8y agoYeesh, that’s a sad thing to burn out over. Python made this decision to avoid assignment expressions a long time ago and has done fine without this capability. Why not just leave well enough alone? Adding a new variation to assignment syntax (just because of the opinion that = vs == is too confusing (even though C and Ruby and many other languages deal with it fine)) is just going to add more confusion to the language. For a line saved here and there?
- cben 8y agoI had the same gut reaction when I heard the PEP even exists. But now I actually read the PEP, it's very well written and makes a reasonably good case that in specific scenarios it will be an improvement. (My second gut reaction was it should have used `as NAME` postfix syntax. The PEP debunks that too. Turns out it previously proposed that and the switch to := was a major improvement :-) The bigger question is whether the gains justify making the language larger... That's subjective, impossible to settle by debate, and the kind of thing a BDFL can help decide one way or the other :-)