Live data from Hacker News

What's Coming in Python 3.8

lwn.net

11–20 of 558 posts

Re: What's Coming in Python 3.8

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

Re: What's Coming in Python 3.8

#12
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 not that common. There's 1 place where its useful imo (comprehensions to avoid duplicate calls), but even that can be handled case by case, and it certainly isn't a common thing.

Re: What's Coming in Python 3.8

#13
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), appart from the walrus operator that I predict will be used with moderation, I don't see any alien looking stuff. This kind of evolution speed is quite conservative IMO.

Whatever you do, there there always will be people complaining I guess. After all, I also hear all the time that Python doesn't change fast enough, or lack some black magic from functional languages.

Re: What's Coming in Python 3.8

#15
post #3
post #2

Why elif en not juste elseif?

Or just else if... but honestly elif is easiest to type and it's not hard to understand.

Hard is being used in a "type the keys" sense. It's more complexity to borrow idioms from languages then slightly change the syntax (PHP!), which isn't necessary. Like most languages, choices are made without evidence (but plenty of anecdotes and personal style).

Re: What's Coming in Python 3.8

#18
post #5

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

I write a good deal of python and I can't think of a line of code that I would use it for besides the while loop on a non-iterable data source, which is such a once in a blue moon case. As mentioned by others, the operator invites more ways to do the same thing, which is not what Python has been viewed as being about.

Re: What's Coming in Python 3.8

#19

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.

Re: What's Coming in Python 3.8

#20
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 not that common. There's 1 place where its useful imo (comprehensions to avoid duplicate calls), but even that can be handled case by case, and it certainly isn't a common thing.

Disagree. In my experience (albeit, not very long, been writing Python since 2007 or so), assigning to a value and checking for truthiness is a very common pattern.
Post reply on HN