Live data from Hacker News

What's Coming in Python 3.8

lwn.net

21–30 of 558 posts

Re: What's Coming in Python 3.8

#21

Speaking as someone who has written Python code almost every day for the last 16 years of my life: I'm not happy about this. Some of this stuff seems to me like it's opening the doors for some antipatterns that I'm consistently frustrated about when working with Perl code (that I didn't write myself). I had always been quite happy about the fact that Python didn't have language features to blur the lines between what…

F-strings have appeared 2 versions ago. All in all, the feedback we have has been overwhelmingly positive, including on maintenance and readability.

I second this. F-strings make string formatting so much more concise. I'm excited about the walrus operator for the same reason.

Re: What's Coming in Python 3.8

#22

The walrus operator does not feel like Python to me. I'm not a big fan of these types of one liner statements where one line is doing more than one thing. It violates the philosophies of Python and UNIX where one function, or one line, should preferably only do one thing, and do it well. I get the idea behind the :=, but I do think it's an unnecessary addition to Python.

This has never felt like a Pythonic principle to me. Python has always seemed like a high-level language that enables dense code. Look at the docs for list comprehensions! https://docs.python.org/2/tutorial/datastructures.html#list-...

A lot of folks see Go as a Python successor which surprises me because I don't think the languages favor the same things at all. Maybe my perspective is weird.

Re: What's Coming in Python 3.8

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

If you complained more specifically it would be possible to discuss. For what was described in article I don't see anything "foreign". Python was always about increasing code readability and those improvements are aligning well with this philosophy.

Re: What's Coming in Python 3.8

#24
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 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 natural order of things.”

― Douglas Adams, The Salmon of Doubt

Re: What's Coming in Python 3.8

#25

Speaking as someone who has written Python code almost every day for the last 16 years of my life: I'm not happy about this. Some of this stuff seems to me like it's opening the doors for some antipatterns that I'm consistently frustrated about when working with Perl code (that I didn't write myself). I had always been quite happy about the fact that Python didn't have language features to blur the lines between what…

F-strings have appeared 2 versions ago. All in all, the feedback we have has been overwhelmingly positive, including on maintenance and readability.

I love f-strings. I just wish tools like pylint would shut up when I pass f-strings to the logging module. I as the developer understand and accept the extra nanosecond of processor time to parse the string that might not be logged anywhere!

Re: What's Coming in Python 3.8

#26
post #5

Walrus operator looks like a great addition, not too much syntax sugar for a common pattern. Why were folks arguing about it?

It's the most controversial feature ever introduced because it goes against a lot of python culture and philosophy.

All in all the debate has been heated and long, but it has been decided that the python community will use it intelligently and rarely, but that when it matters, it can help a lot.

I'm against this feature, while I was pro f-string. However, I'm not too worried about missuse and cultural shift because I've seen 15 years of this show going on and I'm confident on it's going to be indeed tagged as "risky, use it knowing the cost" by everybody by the time 3.8 gets mainstream.

Re: What's Coming in Python 3.8

#27

The walrus operator does not feel like Python to me. I'm not a big fan of these types of one liner statements where one line is doing more than one thing. It violates the philosophies of Python and UNIX where one function, or one line, should preferably only do one thing, and do it well. I get the idea behind the :=, but I do think it's an unnecessary addition to Python.

I support your view, but want to make you aware that early unix did favour a little cleverness to reduce line counts (and even character counts). C's normal assignment operator does what python's walrus does, for example. Or look at pre/post increment/decrement operators. Or look at languages like sed, or bc, they try to be terse over anything else.

Re: What's Coming in Python 3.8

#30
post #6

Without wanting to ignite a debate about the walrus operator (and having not read any of the arguments), I can guess why there was one. It's not clear to me what it does just from reading it, which was always one of Python's beginner-friendlinesses.

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

Post reply on HN