Live data from Hacker News

What's Coming in Python 3.8

lwn.net

371–380 of 558 posts

Re: What's Coming in Python 3.8

#371

Earlier quoted context omitted.

Python 2.7 is not far from that language.

What's stopping people from forking the language at python 2.7? Let the pythonistas add whatever feature they feel like while people who need stability use "Fortran python" or whatever.

Probably most of the people who like writing language interpreters understood that Python 3 fixed a lot of mistakes, so it would be funner to work on.

Though I'm surprised nobody really wrote a transitional fork (six gets you a lot of the way but "Python 2.8 which has _just_ the str/bytes change" would have been useful).

Ultimately Python 2 isn't a better language, it's just the language everyone's code was in...

Re: What's Coming in Python 3.8

#372
post #38

Earlier quoted context omitted.

Because it goes against 20 years of the principles behind the language.

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

I worked with Python for many years as well. I recently switched to another language...

You can browbeat people all you like but we are not forced to work with any particular language and if it diverges away from what we liked we will just switch away.

Re: What's Coming in Python 3.8

#373
post #62

Earlier quoted context omitted.

But now there are two ways to do assignment. That's not very pythonic, is it?

I never felt like there was only one way to do something in Python. Every Stack Overflow question has a multitude of answers ranging from imperative to functional style and with various benefits and drawbacks. Python is one of the least "only one way to do things" languages I've used. This even extends to its packaging system, where you can choose between virtualenv, pipenv, pyenv, etc. Same goes for the installation…

>Every Stack Overflow question has a multitude of answers ranging from imperative to functional style and with various benefits and drawbacks.

This is one of the reasons I love Python. It's a great exercise to rewrite the same code imperative, recursive, with generators, with iterables, etc. Python is very good at supporting a wide range of programming styles.

Re: What's Coming in Python 3.8

#374
post #314
post #281

Earlier quoted context omitted.

I truly wish this would become a thing. It's really frustrating having to update my installed packages and my code for some stupid change the language designers thought is sooo worth it. Just stabilize the bloody thing so I can do some work. Updating code so it meshes with the "latest and greatest" is _not real work_.

Fixing the entirely broken string/bytes mess up in Python 2 was worth it by itself. For bonus points old style classes went away, and the language got a significant speed boost. And now it’s not going to die a slow death, choking on the past poor decisions it’s burdened with. Trivializing that by suggesting it was some offhand, unneeded solution to a problem that some dreamy “language designer” thought up is at best…

> and the language got a significant speed boost.

I have not seen a clear win in real benchmarks. 3 was slower for the longest time, and nowadays it seems head to head depending on the project.

Re: What's Coming in Python 3.8

#375

Earlier quoted context omitted.

Absolutely agree. How many times have you heard "that was true until Python 3.4 but now is no longer an issue" or "that expression is illegal for all Pythons below 3.3", and so on. Not to mention the (ongoing) Python 2->3 debacle.

> Not to mention the (ongoing) Python 2->3 debacle. When will this talking point die? It's not "ongoing". There's an overwhelming majority who have adopted Python 3 and a small population of laggards.

> There's an overwhelming majority who have adopted Python 3 and a small population of laggards.

That small population includes every BigCo with a large python codebase.

Re: What's Coming in Python 3.8

#376

Earlier quoted context omitted.

> := 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…

See: https://en.wikipedia.org/wiki/Assignment_(computer_science)#... At least 18 prominent languages use that syntax.

> At least 18 prominent languages use that syntax.

There aren't even 18 prominent languages...

Re: What's Coming in Python 3.8

#377
post #336

Earlier quoted context omitted.

> In a language with less features, you might have to write slightly more code, but the code you write will be more readable to everyone else. I disagree with this, which is precisely why I prefer feature rich languages like Java or better yet Kotlin. It doesn't get much more readable than something like: users.asSequence() .filter { it.lastName.startsWith("S") } .sortedBy { it.lastName } .take(3) Now try writing tha…

Python is a little more readable, but both Python and Kotlin are perfectly clear in this case: sorted((u for u in users if u.last_name.startswith("S")), key=lambda u: u.last_name )[:3] If last_name is a function, which it often would be in Python, it gets better: sorted((u for u in users if last_name(u).startswith("S")), key=last_name )[:3] However, I think you probably got the sort key wrong if you're taking the fir…

I disagree this python version is as readable and here’s why. It’s about as many characters but more complex. The Kotlin version performs several distinct actions, each being clear to its purpose. These actions have the same syntax (eg requires less parsing effort). The Python version mixes at least 4 different language syntax/features, being list comprehension, if special form in the list comprehension, keywords, and lambda functions.

On top of the lessened readability, the Kotlin version makes it very easy to add, subtract, or comment out lines/actions which really helps when debugging. The Kotlin version is almost identical in structure to how you’d do it in Rust, Elixir, etc.

Re: What's Coming in Python 3.8

#378
post #271

Earlier quoted context omitted.

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.

"resistance-to-change for-no-reason" vs "resistance-to change-for-no-reason" :)

[deleted]

Re: What's Coming in Python 3.8

#379

Earlier quoted context omitted.

This is why a lot of scientific code still uses fortran, code written several decades ago still compiles and has the same output. How long has the code which was transitioned to python lasted?

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

We will review that statement in 30 years!

Re: What's Coming in Python 3.8

#380
post #339
post #275

Earlier quoted context omitted.

Haha, what was that quote? Something like, any language is going to iterate towards a crappy version of lisp.

Greenspun's Tenth Rule[0] Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. - Philip Greenspun [0] https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule

How would you subvert Greenspun in large codebases without Common Lisp? I once used Drools the rules engine which used a dynamic scripting language on Java objects. Python could have replaced that language, with much better tooling, errors etc.
Post reply on HN