Live data from Hacker News

What's Coming in Python 3.8

lwn.net

361–370 of 558 posts

Re: What's Coming in Python 3.8

#361

The problem with modern Python is that it's trying to recreate C# or Java. Which leaves it with nothing, because it'll only end up an inferior version of the languages/platforms of which it's attempting to duplicate. When I was into Python, I liked it because it was a tighter, more to the basics language. Not having 4 ways to format strings and so forth. I don't think Python can defeat Java by becoming Java. It'll lo…

My vision of a language like Python would be only 1-way to do things, and in the event someone wants to add a 2nd way, a vote is taken. By that standard, the walrus operator is not only acceptable but essential. Right now there are at least 3 ways to process data from a non-iterator: # 1: loop condition obscures what you're actually testing while True: data = read_data() if not data: break process(data) # 2: 7 lines…

I have no opinion on this new feature, so I can't really engage in that debate over it. I still see no reason for smaller languages like Python to not operate as a true direct democracy. There's clearly frustration over the leadership in the PSF, so much so that Guido capitulated under the stress.

Re: What's Coming in Python 3.8

#362

Earlier quoted context omitted.

>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 won't cause errors)? This is relevant to what I've been doing in OpenCV with reading frames from videos! In tutorial examples on the web, you'll se…

That example can also be tackled with Python's little-known feature of calling the built-in `iter` with a second argument: > for line in iter(f.readline, ''): > ... # process line See: https://docs.python.org/3/library/functions.html#iter

This is useful, but two totally different functions with the same name distinguished only by the presence, not even the value of an unused argument. Where else does anything like this exist in the language? Seems problematic.

Re: What's Coming in Python 3.8

#363
post #337

Earlier quoted context omitted.

A little off-topic but how does that work? Is 'it' a magic variable referring to the first argument? Never seen magic variables that blend into lambdas like that before... would've expected $1 or something like that.

Yeah, a bit of PG’s Arc influence in the wild.

I believe groovy made this popular rather than arc, and it's likely where kotlin's come from, due to being in the java ecosystem.

Re: What's Coming in Python 3.8

#364

Earlier quoted context omitted.

I'm 34 and I don't like this, so it's definitely not only those above 35. Jokes aside, I would say I'm a minimalist and this is where my resistance comes from. One of the things that I dislike the most in programming is feature creep. I prefer smaller languages. I like the idea of having a more minimal feature set that doesn't change very much. In a language with less features, you might have to write slightly more c…

Furthermore, I did my grad studies in compilers. I've thought about writing an optimizing JIT for Python. I really feel like CPython is needlessly slow, and it's kind of embarassing, Many have tried and failed, Google and Dropbox to name a couple, and countless other attempts.

It lags a bit in releases, but I understood pypy to be essentially successful?

Re: What's Coming in Python 3.8

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

The '*' and '/' in function parameter lists for positional/keyword arguments look particularly ugly and unintuitive to me. More magic symbols to memorize or look up.

I also cannot honestly think of a case where I want that behaviour.

The "pow" example looks more like a case where the C side should be fixed.

Re: What's Coming in Python 3.8

#366
post #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 CLO…

C compilers like GCC and Clang have dialect selection options that work; if you pick -std=c90, you can write C like it's 1990.

Re: What's Coming in Python 3.8

#367
post #362

Earlier quoted context omitted.

That example can also be tackled with Python's little-known feature of calling the built-in `iter` with a second argument: > for line in iter(f.readline, ''): > ... # process line See: https://docs.python.org/3/library/functions.html#iter

This is useful, but two totally different functions with the same name distinguished only by the presence, not even the value of an unused argument. Where else does anything like this exist in the language? Seems problematic.

> This is useful, but two totally different functions with the same name distinguished only by the presence, not even the value of an unused argument.

The sentinel argument is not unused.

> Where else does anything like this exist in the language?

In the narrow sense of “in the language” (builtins only), it's unique. There may be other examples in stdlib. That aside, functions that do a descriptively similar thing (i.e.,“build an iterator”) but where the details of how they do it differ significantly by aritt aren't weird among programming languages generally; don't see why it would be particularly problematic.

Re: What's Coming in Python 3.8

#368

Earlier quoted context omitted.

I'm 34 and I don't like this, so it's definitely not only those above 35. Jokes aside, I would say I'm a minimalist and this is where my resistance comes from. One of the things that I dislike the most in programming is feature creep. I prefer smaller languages. I like the idea of having a more minimal feature set that doesn't change very much. In a language with less features, you might have to write slightly more c…

> In a language with less features, you might have to write slightly more code, but the code you write will be more readable to everyone else. I disagree with this, which is precisely why I prefer feature rich languages like Java or better yet Kotlin. It doesn't get much more readable than something like: users.asSequence() .filter { it.lastName.startsWith("S") } .sortedBy { it.lastName } .take(3) Now try writing tha…

Simple core languages that are syntactically extensible with libraries have the best of both worlds: https://vvvvalvalval.github.io/posts/2018-01-06-so-yeah-abou...

Re: What's Coming in Python 3.8

#369

Earlier quoted context omitted.

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

Really interesting. For the skeptics, this is not just a proof of concept. There is a real app made using this language: https://volt-app.com/

and the REPL only leaks 1MB [1] to compile and run a hello world program.

1: https://github.com/vlang/v/issues/514

Re: What's Coming in Python 3.8

#370

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…

Wish granted: https://en.m.wikipedia.org/wiki/Brainfuck
Post reply on HN