Also fix the GIL.
What's Coming in Python 3.8
151–160 of 558 posts
Re: What's Coming in Python 3.8
#152Earlier quoted context omitted.
“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 n…
Does that mean someone born in 2008 will think C++ is simple and elegant?
Re: What's Coming in Python 3.8
#153Earlier quoted context omitted.
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
#154Earlier quoted context omitted.
My metric for this is to put some of my freshest student in front of a code and see how they deal with it. How easily can they understand it ? How easily can they write it ? Debug it ? They are most of the time a fantastic indicator of the cognitive load a feature will add in prod. Because of course a feature doesn't exist in a vacuum, it's always in a more complex context. So what's easy to understand for a student…
I for one predict that the new operator will appear very sparingly, in while loops and code golf competitions. There are already so many complicated semantics about mutability, iteration, bytes/strings, scoping, et al. And yet somehow a tiny piece of syntax that finally lets us stop writing "while true/break" is the big pain point?
Re: What's Coming in Python 3.8
#155Re: What's Coming in Python 3.8
#156Earlier 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…
Re: What's Coming in Python 3.8
#157I 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…
How long has the code which was transitioned to python lasted?
Re: What's Coming in Python 3.8
#158Earlier quoted context omitted.
understanding lines in isolation is precisely besides the point here, because the code pattern has to be understood as a whole.
I don’t see why. ‘Assign x’ and ‘is x truthy’ can be understood separately. Worry about what x is being assigned. Then worry about whether its value is truthy.
to quote the PEP:
reductor = dispatch_table.get(cls)
if reductor:
rv = reductor(x)
else:
reductor = getattr(x, "__reduce_ex__", None)
if reductor:
rv = reductor(4)
else:
reductor = getattr(x, "__reduce__", None)
if reductor:
rv = reductor()
else:
raise Error(
"un(deep)copyable object of type %s" % cls)
becomes: if reductor := dispatch_table.get(cls):
rv = reductor(x)
elif reductor := getattr(x, "__reduce_ex__", None):
rv = reductor(4)
elif reductor := getattr(x, "__reduce__", None):
rv = reductor()
else:
raise Error("un(deep)copyable object of type %s" % cls)Re: What's Coming in Python 3.8
#159Earlier quoted context omitted.
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.
Well, maybe not for every language, but probably for a language where simplicity has been a major feature.
Re: What's Coming in Python 3.8
#160Python 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'm working on a language with a focus on simplicity and "only one way to do it": https://vlang.io The development has been going quite well: https://github.com/vlang/v/blob/master/CHANGELOG.md