Live data from Hacker News

What's Coming in Python 3.8

lwn.net

261–270 of 558 posts

Re: What's Coming in Python 3.8

#261
post #30

Earlier quoted context omitted.

> It's not clear to me what it does just from reading it How isn't it entirely obvious? := is the assignment operator in tons of languages, and there's no reason not to have assignment be an expression (as is also the case in many languages).

> := is the assignment operator in tons of languages It is? Which ones? Other than Go, I can not think of a single language that has ":=" as an operator. Java does not, JavaScript does not, C/C++ do not, Ruby does not, I don't think PHP does, Erlang/Elixir do not, Rust does not... (I could be wrong on these, but I've personally never seen it in any of these languages and I can't find any mention of it in these langua…

It was the assignment operator in Algol, which along with Fortran and Lisp was one of the most influential programming languages for decades. Its basic syntax was the prototypical "psuedo-code" in textbooks for decades after that.

The operator was inherited by Pascal, Ada, Delphi. That line of language syntax died off in the late 90's though, so I can see why younger (and in particular self-taught) programmers wouldn't be familiar with it.

Re: What's Coming in Python 3.8

#262

There's a lot of talk in this thread about Python going down-hill and becoming less obvious/simple. I rather like modern python, but I agree that some features (like async/await, whose implementation fractures functions and libraries into two colors [0]) seem like downgrades in "Pythonicity". That said, I think some things have unquestionably gotten more "Pythonic" with time, and the := operator is one of those. In c…

The problem with `while line := f.readline():` is that it takes preasure of library writers. You should really just do `for line in f:`. If the library only has a `next` function, it needs to be fixed.

Re: What's Coming in Python 3.8

#263
post #216

Earlier quoted context omitted.

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.

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...

The idea was accepted quickly, the rest of the debate was on its spelling and scope.

Re: What's Coming in Python 3.8

#264

Earlier quoted context omitted.

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... :-(

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…

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

#265
post #58
post #8

Python looks more and more foreign with each release. I'm not sure what happened after 3.3 but it seems like the whole philosophy of "pythonic", emphasizing simplicity, readability and "only one straightforward way to do it" is rapidly disappearing.

i've been hearing this since 1.5 => 2.0 (list comprehensions), then 2.2 (new object model), 2.4 (decorators)... happy python programmer since 1.5, currently maintaining a code base in 3.7, happy about 3.8.

I cut my teeth on 2.2-2.4 and remember getting my hand slapped when 2.4 landed and I used a decorator for the first time.

It was to allow only certain HTTP verbs on a controller function. A pattern adopted by most Python web frameworks today.

Re: What's Coming in Python 3.8

#266
post #8

Python looks more and more foreign with each release. I'm not sure what happened after 3.3 but it seems like the whole philosophy of "pythonic", emphasizing simplicity, readability and "only one straightforward way to do it" is rapidly disappearing.

Most code still look like traditional Python. Just like meta programming or monkey patching, the new features are used sparingly by the community. Even the less controversial type hints are here on maybe 10 percent of the code out there. It's all about the culture. And Python culture has been protecting us from abuses for 20 years, while allowing to have cool toys. Besides, in that release (and even the previous one)…

What's an example of black magic from functional languages?

Re: What's Coming in Python 3.8

#267
post #38

Earlier quoted context omitted.

Actually it doesn't violate any of the principles behind the language. It could have been there from day one, like tons of others things added later and now totally loved. I should know, I've worked with Python for 22 years...

Guido disagrees and rejected the idea multiple time in the last 2 decades. I think he worked on Python for a long time too :) This feature is kind of a symbol, the first real decision of the transition between the bdfl and the next era. I'm not worried about it, but yes, it was really against python core principles.

See other replies. Guido was for the operator.

Re: What's Coming in Python 3.8

#268
post #240
post #8

Python looks more and more foreign with each release. I'm not sure what happened after 3.3 but it seems like the whole philosophy of "pythonic", emphasizing simplicity, readability and "only one straightforward way to do it" is rapidly disappearing.

This is what happens when you lose a BDFL. While things become more "democratic", you lose the vision and start trying to make everyone happy.

Walrus operator is the direct result of the BDFL pushing it over significant objection.

Re: What's Coming in Python 3.8

#269

Earlier quoted context omitted.

> How long has the code which was transitioned to python lasted? A long time. 2to3 was good for ~90% of my code, at least

Good for 90% of your code is not equivalent to getting precisely the same results from unmodified code written in the 80s.

More likely to mean 90% of projects, not 90% of each file, which would mean that every one was broken.

Re: What's Coming in Python 3.8

#270
post #24

Earlier quoted context omitted.

“I've come up with a set of rules that describe our reactions to technologies: 1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. 2. Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. 3. Anything invented after you're thirty-five is against the n…

It's wrong to frame this as resistance to change for no reason. See my other comment. I see some of this stuff as repeating mistakes that were made in the design of Perl. ...but there are quite few people around these days who know Perl well enough to recognize the way in which history is repeating itself, and that has at least something to do with age.

[deleted]
Post reply on HN