Live data from Hacker News

What’s New in Python 3.8

docs.python.org

211–220 of 381 posts

Re: What’s New in Python 3.8

#211

Earlier quoted context omitted.

Yeah, it’s super unfortunate how the existence of py27 security patches magically stops all py3 users from doing any work. It’s sort of how the existence of c prevents anyone from using rust.

Yeah right, because splitting the community hasn't caused any problems at all... Get a grip; you are failing at whatever your job is if you're responsible for a python2 project and haven't moved it to python3 by now.

Python3 was a bad idea. Guido himself acknowledged it. There was no point in breaking everything.

The split was initiated by core developers, not by the community.

Re: What’s New in Python 3.8

#212
post #140
post #106

Earlier quoted context omitted.

C++ is one of the most successful languages.

Despite its flaws, not due to them. Same can be said about e.g. Cobol.

False.

There have been dozens of working C++ competitors over the years, each one technically as good as C++.

They all failed because their authors are good at writing languages, but very bad at knowing how languages are used in the real world.

The C++ committee really knows what it's doing, you're not going to do anything useful in this space without actually understanding the problem domain.

TL;DR - yes, C++ is complex, but that is because programming is complex. Your attitude of "programming is hard, let's go (language) shopping" will not displace C++.

Re: What’s New in Python 3.8

#213
post #22

As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's us…

Not all releases have to be ground breaking, especially in a mature and stable language. Cleaning up things, putting other things in place for major releases, that's commendable too.

I did not follow all the conversation around the typing system but isn't the whole point of it to propose optimizations in the future? I find it exciting

Re: What’s New in Python 3.8

#214
post #83

Earlier quoted context omitted.

> As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. Python is a fairly old, mature language. What features would you have been especially excited about?

The f-strings from 3.6 are a (relatively) recent feature that I have absolutely loved. I'd go so far as to say they are my favorite feature introduced by Python 3. I'm also looking forward to PEP-554 [0], which allows for "subinterpreters" for running concurrent code without removing the GIL or incurring the overhead of subprocesses. [0] https://www.python.org/dev/peps/pep-0554/

f-strings are great. Much nicer than ".format". I hope in a next iteration of the language all strings will be f-strings by default, avoiding the need to prefix them by a silly "f".

Re: What’s New in Python 3.8

#215

Is Python now becoming the new C++?

This is fair criticism. I've worked with Python for many years now, and one of the things that attracted me was that there was always a fsirly static "Pythonic" way to do things. The language has now grown so much that 80% of the people only use 20% of the language, but not always the same 20%, making it difficult to read other people's code. And all the syntactic changes contribute to fragmentation (not every project can have its Python interpreter upgraded regularly).

There's something to be said for a more stable, if less elegant, language.

Re: What’s New in Python 3.8

#216
post #210
post #69

Earlier quoted context omitted.

> The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. The primary one I want is if m := re.match(...): print(m.group(1)) and while s := network_service.read(): process(s) both of which are both clearer and less error-prone than their non-walrus variants. The other one that I would have found useful an hour ago is in interactive exploration with comprehensions. I freq…

I think there are a lot of use-cases for some kind of dedicated "if-with-outputs" syntax, where you have some extra variables available inside the if-block if the condition matched. Such a syntax could cover a lot of the problems of double execution but also prevent hard to understand code like the walrus operator. ... I've got no idea how the syntax could look though.

How would this hypothetical syntax differ from the walrus operator? I.e. what is hard to understand with the walrus operator that wouldn't be with this new hypothetical syntax and why?

Re: What’s New in Python 3.8

#217
post #116
post #115

Earlier quoted context omitted.

Sometimes you just check for a match (e.g.of entire string) and define no groups. The problem is not in re.match but in None being a relatively poor Maybe / Optional (still ways better than C-style `null` of many other languages).

> Sometimes you just check for a match re.match vs re.search

[deleted]

Re: What’s New in Python 3.8

#218
post #22

As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's us…

> Same with the forced positional/keyword arguments

I also thought, why bother at first until I learned this is already a feature in python, but only for c-functions. So of course it makes sense to level the playing field.

Re: What’s New in Python 3.8

#219
post #63
post #22

As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's us…

There have been many times when I've wished python had something like the walrus operator. In particular, without the walrus operator you can't write an if-elif chain of regex comparisons. The best way to that that I've been able to find is with a bunch of nested if-else statements.

And working with queues/stacks is much more pleasant (which I seem to do a lot...).

Re: What’s New in Python 3.8

#220
post #72

Earlier quoted context omitted.

Perl devs have been using the walrus expression for decades, but we just called it "assigning a variable with local scope in an expression". $ perl $a = "foo"; if ( my $a = "bar" ) { print "$a\n" } print "$a\n" bar foo

The reason why assignment expressions initially were not allowed in Python and why they had to introduce "walrus" was because in languages that used single equal sign for assignment enable to easily make bugs by typing "=" instead of "==".

I find it strange to sacrifice syntactical simplicity for bug prevention in a language that needs deep testing anyway because it's neither nil- nor type-safe. But maybe I'm just to used to inline "=".
Post reply on HN