Live data from Hacker News

What's Coming in Python 3.8

lwn.net

81–90 of 558 posts

Re: What's Coming in Python 3.8

#81
I find the different philosophies of languages amazing.

Just recently 'Declined Proposal: A built-in Go error check function, “try”' https://news.ycombinator.com/item?id=20454966 made the front page, explaining how a controversial potential Go feature was being declined early.

Python on the other hand, went ahead with what seems to be a proposal at least as controversial as 'try' in Go.

Re: What's Coming in Python 3.8

#82
":=" is a fairly common operator symbol that I've seen used in other programming languages (e.g. Golang) and in mathematics. But I've never seen it called the "walrus" operator. Its fitting and memorable though, I like it.

Re: What's Coming in Python 3.8

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

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.

Re: What's Coming in Python 3.8

#85
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…

In Ada, = is equals and := is assignment.

Re: What's Coming in Python 3.8

#86

I long for a language which has a basic featureset, and then "freezes", and no longer adds any more language features. You may continue working on the standard library, optimizing, etc. Just no new language features. In my opinion, someone should be able to learn all of a language in a few days, including every corner case and oddity, and then understand any code. If new language features get added over time, eventua…

Isn't that what C is?

Re: What's Coming in Python 3.8

#87

I dont like the positional only arguments.. Really, I dont like anything that trys to force a future developer into using your code the way you expect them to.

One of the use-cases for positional-only arguments strikes me as being very sensible:

    def my_format(fmt, *args, **kwargs):
        ...
        fmt.format(*args, **kwargs)
suffers from a bug if you want to pass fmt as a keyword argument (e.g. `my_format('{fmt}', fmt='int')`). With positional-only arguments that goes away.

You could always force developers into using your code the way you expect by parsing args/kwargs yourself, so it's not like this really changes anything about the "restrictiveness" of the language.

Re: What's Coming in Python 3.8

#89

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…

As someone who has written Python code almost every day for both professional and personal projects for a few years: I’m really happy about these assignment expressions. I wish Python would have more expressions and fewer statements, like functional languages.

Re: What's Coming in Python 3.8

#90
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…

[deleted]
Post reply on HN