Live data from Hacker News

What's Coming in Python 3.8

lwn.net

141–150 of 558 posts

Re: What's Coming in Python 3.8

#141

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…

Try C maybe? It is still updated, but only really minor tweaks for optimisation.

Also Common lisp specs never changed since the 90s and is still usefull as a "quick and dirty" language, with few basic knowledge required. But the "basic feature set" can make everything, so the "understand any code" is not really respected. Maybe Clojure is easier to understand (and also has a more limited base feature set, with no CLOS).

Re: What's Coming in Python 3.8

#142

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…

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. Why should this be true for every language? Certainly we should have languages like this. But not every language needs to be like this.

Verrrrrrry few languages in common use are like this.

Re: What's Coming in Python 3.8

#143
post #111

>Debug support for f-strings. F strings are pretty awesome. I’m coming from JavaScript and partially java background. JavaScript’s string concatenation can become too complex and I have difficulty with large strings. >Python 3.8 programmers will be able to do: print(f'{foo=} {bar=}') Pretty cool way to help with debugging. There are so many times, including today, I need to print or log some debug string. “Debug var1…

By the way, this has nothing do with f strings but for debugging JavaScript you can do something like

console.log({var1,var2,var3});

And the logged object will get created with the variables content and the variable nem as key, so it will get logged neatly like

{var1: "this is var1", var2: 2, var3: "3"}

Re: What's Coming in Python 3.8

#144

Earlier quoted context omitted.

This honestly makes it seem more confusing to me. The fact that there is now an operator that can only be used in certain statements just makes things more confusing. And if there really is no overlap, then why wasn't the "=" operator just extended to also work in expressions? "while chunk = read()" seems like it makes just as much sense without adding the confusion of another operator.

I expect the PEP authors want to avoid the "while chunk == read()" class of bugs ninjaedit: indeed https://www.python.org/dev/peps/pep-0572/#why-not-just-turn-...

And also the converse (but no less dangerous) "if value = true"

Re: What's Coming in Python 3.8

#145

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…

Elixir?

From the v1.9 release just a few weeks ago: https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-releas...

> As mentioned earlier, releases was the last planned feature for Elixir. We don’t have any major user-facing feature in the works nor planned. I know for certain some will consider this fact the most excing part of this announcement!

> Of course, it does not mean that v1.9 is the last Elixir version. We will continue shipping new releases every 6 months with enhancements, bug fixes and improvements.

Re: What's Coming in Python 3.8

#146
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 contrast, this early Python feature (mentioned in an article [1] linked in the main one) strikes me as almost comically unfriendly to new programmers:

> Python vowed to solve [the problem of accidentally assigning instead of comparing variables] in a different way. The original Python had a single "=" for both assignment and equality testing, as Tim Peters recently reminded him, but it used a different syntactic distinction to ensure that the C problem could not occur.

If you're just learning to program and know nothing about the distinction between an expression and a statement, this is about as confusing as shell expansion (another context-dependent syntax). It's way too clever to be Pythonic. The new syntax, though it adds an extra symbol to learn, is at least 100% explicit.

I'll add that := fixes something I truly hate: the lack of `do until` in Python, which strikes me as deeply un-Pythonic. Am I supposed to break out of `while True`? Am I supposed to set the variable before and at the tail of the loop (a great way to add subtle typos that will cause errors)? I think it also introduces a slippery slope to be encouraged to repeat yourself: if assigning the loop variable happens twice, you might decide to do something funny the 2:Nth time to avoid writing another loop, and that subtlety in loop variable assignment can be very easy to miss when reading code. There is no general solution I've seen to this prior to :=. Now, you can write something like `while line := f.readline()` and avoid repetition. I'm very happy to see this.

[0] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...

[1] https://lwn.net/Articles/757713/

[edit] fixed typos

Re: What's Coming in Python 3.8

#147

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…

Common Lisp seems to tick the boxes. The syntax is stable and it doesn't change. New syntax can be added through extensions (pattern matching, string interpolation, etc). The language is stable, meaning code written in pure CL still runs 20 years later. Then there are de-facto standard libraries (bordeaux-threads, lparallel,…) and other libraries. Implementations continue to be optimized (SBCL, CCL) and to develop core features (package-local-nicknames) and new implementations arise (Clasp, CL on LLVM, notably for bioinformatics). It's been rough at the beginning but a joy so far.

https://github.com/CodyReichert/awesome-cl

Re: What's Coming in Python 3.8

#148
post #130

Earlier quoted context omitted.

we added new syntax for a code pattern that has inherent complexity which can't be reduced.

It can be reduced into two simpler lines can’t it, both of which could be understood in isolation.

understanding lines in isolation is precisely besides the point here, because the code pattern has to be understood as a whole.

Re: What's Coming in Python 3.8

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

Pascal uses := as an assignment operator.

Actually, there are a lot of other variants assignments get written in various computer languages. https://en.wikipedia.org/wiki/Assignment_(computer_science)#...

Re: What's Coming in Python 3.8

#150

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…

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.

Post reply on HN