News for hackers. Stuff that matters.
Re:What's Coming in Python 3.8 by ehsankia on Wednesday July 17, 2019 @06:59PM (#20464897)
Was the controversy really about the need for the feature? I thought most people agreed it was a great feature to have, and most of the arguments were about `:=` vs re-using `as` for the operator.
Re:What's Coming in Python 3.8 by pmart123 on Wednesday July 17, 2019 @07:54PM (#20465277)
I like "as" instead. I didn't realize that was on the table. To me, it seems more Pythonic given the typical English-like Python syntax of "with open(path) as file", "for element in items if element not in things", etc.
Re:What's Coming in Python 3.8 by mixmastamyk on Wednesday July 17, 2019 @08:10PM (#20465374)
It had some drawbacks, which a great majority of the time won't apply. I too would have preferred an "as" clause that limited to if-statements, maybe while, and comprehensions.
Re:What's Coming in Python 3.8 by Noumenon72 on Wednesday July 17, 2019 @11:04PM (#20466327)
"if m as re.match(p1, line)" is not very English-like.
Re:What's Coming in Python 3.8 by clinta on Wednesday July 17, 2019 @11:37PM (#20466474)
Because the variable goes after the as. if re.match(p1, line) as m:
Re:What's Coming in Python 3.8 by carver on Wednesday July 17, 2019 @11:23PM (#20466406)
`if re.match(p1, line) as m`, maybe?
Re:What's Coming in Python 3.8 by collinmanderson on Thursday July 18, 2019 @08:50AM (#20469199)
Yes, this is what I would expect. Much like a with statement.
Re:What's Coming in Python 3.8 by linsomniac on Wednesday July 17, 2019 @07:15PM (#20465000)
I don't know in this case, but I do know that the Python community tends to have strong opinions about things. The := resulted in Guido stepping down, which I think is a good indicator that there wasn't agreement that it was "a great feature to have" and just down to syntax... :-(
Re:What's Coming in Python 3.8 by dual_basis on Wednesday July 17, 2019 @07:51PM (#20465256)
To be fair, Guido stepped down because of the way the community reacted.

"The straw that broke the camel’s back was a very contentious Python enhancement proposal, where after I had accepted it, people went to social media like Twitter and said things that really hurt me personally. And some of the people who said hurtful things were actually core Python developers, so I felt that I didn’t quite have the trust of the Python core developer team anymore."

Source: https://www.infoworld.com/article/3292936/guido-van-rossum-r...

Note that Guido also was in support of the walrus operator, it's not like he stepped down because he disagreed with it.

Re:What's Coming in Python 3.8 by darkpuma on Wednesday July 17, 2019 @08:13PM (#20465391)
It's really disappointing that people could get so worked up, over what is essentially deciding which color to paint the shed, that they chase off the project founder. I wonder if there is any way for open source communities to effectively promote the "take a step back and remember what really matters in life" approach to conflict resolution.
Re:What's Coming in Python 3.8 by toyg on Wednesday July 17, 2019 @09:04PM (#20465671)
Guido wasn't chased off, he is still in the core group. He just isn't BDFL anymore -- which, from a certain point of view, might be the best of both worlds. As a long-time python user and small-time advocate, I felt the walrus was a really bad decision.
Re:What's Coming in Python 3.8 by Aozi on Thursday July 18, 2019 @08:02AM (#20468867)
>I wonder if there is any way for open source communities to effectively promote the "take a step back and remember what really matters in life" approach to conflict resolution.

We've spent decades debating on the merits of spaces vs tabs, and Vim vs Emacs, and a ton of other completely pointless stuff.

What you're hoping is just a pipe dream, people will get invested in the most petty and asinine stuff out there, and take it as a personal insult if you disagree.

Re:What's Coming in Python 3.8 by kbd on Wednesday July 17, 2019 @07:19PM (#20465030)
All discussion I've ever seen was about the need for the feature, not its spelling. I didn't even know "as" was proposed, but in fact it is an "alternate spelling" they considered[1] in the PEP.

[1] https://www.python.org/dev/peps/pep-0572/#alternative-spelli...

Re:What's Coming in Python 3.8 by mixmastamyk on Wednesday July 17, 2019 @08:12PM (#20465385)
The idea was accepted quickly, the rest of the debate was on its spelling and scope.