News for hackers. Stuff that matters.
Re:What's Coming in Python 3.8 by sleavey on Wednesday July 17, 2019 @04:46PM (#20463822)
Without wanting to ignite a debate about the walrus operator (and having not read any of the arguments), I can guess why there was one. It's not clear to me what it does just from reading it, which was always one of Python's beginner-friendlinesses.
Re:What's Coming in Python 3.8 by coldtea on Wednesday July 17, 2019 @05:14PM (#20464090)
>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).

Re:What's Coming in Python 3.8 by txcwpalpha on Wednesday July 17, 2019 @05:36PM (#20464306)
> := 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 languages' docs).

I tried looking around the internet at various popular programming languages and the only ones I could find that use ":=" are: Pascal, Haskell (but it's used for something else than what Python uses it for), Perl (also used for something else), and Scala (but in Scala it isn't officially documented and doesn't have an 'official' use case).

I don't have a strong opinion about ":=" in Python but I do agree that it's unintuitive and thus not very "Pythonic".

Re:What's Coming in Python 3.8 by pavon on Wednesday July 17, 2019 @08:10PM (#20465375)
It was the assignment operator in Algol, which along with Fortran and Lisp was one of the most influential programming languages for decades. Its basic syntax was the prototypical "psuedo-code" in textbooks for decades after that.

The operator was inherited by Pascal, Ada, Delphi. That line of language syntax died off in the late 90's though, so I can see why younger (and in particular self-taught) programmers wouldn't be familiar with it.

Re:What's Coming in Python 3.8 by hathawsh on Wednesday July 17, 2019 @06:12PM (#20464570)
See: https://en.wikipedia.org/wiki/Assignment_(computer_science)#...

At least 18 prominent languages use that syntax.

Re:What's Coming in Python 3.8 by megla_ on Thursday July 18, 2019 @04:39AM (#20467935)
I genuinely haven't heard of 13 of those and I'd say I'm quite interested in learning about languages. The few that I know, were just briefly mentioned by a professor, so I don't know anything apart from the name.

What qualifies as prominent to you? How old are you? On Tiobe Index only Pascal and Go are in the first 50, while half of them aren't even listed in the first 100. Sure they're important and had an impact on new languages, but most of them were made ~50 years ago.

So many new languages were developed since then, which are far more useful and prominent than these legacy ones. If almost none of the modern ones have implemented it so far, is it really that useful/needed?

Re:What's Coming in Python 3.8 by coldtea on Thursday July 18, 2019 @04:45AM (#20467960)
>I genuinely haven't heard of at least a third of them and I'd say I'm quite interested in trying new (and possibly unusual) languages.

But perhaps not as interested in trying old and significant languages?

>What qualifies as prominent to you? On Tiobe Index only Pascal and Go are in the first 50, while half of them aren't even listed in the first 100. Sure they're important and had an impact on new languages, but most of them were made ~50 years ago.

Well, Lisp was made 60+ years ago, and C 50 years ago, so?

Besides Go, Smalltalk, Ada, and Pascal would be significant languages in any book, and I'd add Simula, Oberon, Eiffel, and Dylan to the list.

Seriously, if one haven't at least heard of Simula (the father language of OO) I'm not sure how qualified they are to pass PL judgement.

Re:What's Coming in Python 3.8 by megla_ on Thursday July 18, 2019 @06:53AM (#20468512)
>Well, Lisp was made 60+ years ago, and C 50 years ago, so?

Well, they're still seeing widespread use, that's why they're on Tiobe, while others faded into obscurity. Those languages are historically significant, but nowadays they're basically useless apart from scientific use and maintaning old software.

Maybe you should understand that the majority of programmers are younger than Python and don't study the same material they did 30 years ago, because a whole lot of history happened in that time. Also I'm not sure how not knowing about Simula makes me unqualified for anything.

I've noticed, not just in this reply, but in all of your comments; your condescending tone and indirect addressing make you seem like an unpleasant person.

Using these qualities makes one seem like some stuck-up pseudointellectual boomer.

Re:What's Coming in Python 3.8 by Redoubts on Thursday July 18, 2019 @12:49AM (#20466795)
> At least 18 prominent languages use that syntax.

There aren't even 18 prominent languages...

Re:What's Coming in Python 3.8 by txcwpalpha on Wednesday July 17, 2019 @06:46PM (#20464810)
That's more than I was aware of, but I would hardly call 90% of those "prominent". Sorry to any fans of those languages, but I doubt even most people here on HN have even heard about over half of the languages in that ":=" list.
Re:What's Coming in Python 3.8 by coldtea on Thursday July 18, 2019 @04:48AM (#20467974)
If someone is not, not a user, but familiar with ALGOL, Simula, Pascal, Modula, Ada, PL/M, Smalltalk, Eiffel, and Oberon, they should not really promote their programming language ideas as relevant...

The fact that they use some "new languages" (e.g. whatever derivative stuff happens to be in fashion atm) and are not even aware of the debt of those languages to the list above, doesn't qualify them...

Re:What's Coming in Python 3.8 by txcwpalpha on Thursday July 18, 2019 @10:44AM (#20470327)
Just because you're an old programming elitist that is familiar with completely out-of-use (and most not even maintained now) languages doesn't qualify you, either. I don't gatekeep book authors by their knowledge of the ancient Sumerian language, and anyone who tries to do so would rightfully be laughed out of the room.
Re:What's Coming in Python 3.8 by Redoubts on Thursday July 18, 2019 @09:54AM (#20469764)
> If someone is not, not a user, but familiar with ALGOL, Simula, Pascal, Modula, Ada, PL/M, Smalltalk, Eiffel, and Oberon, they should not really promote their programming language ideas as relevant...

If programming is intellectual onanism for you, then sure you're free to entertain that idea.

Re:What's Coming in Python 3.8 by dwohnitmok on Wednesday July 17, 2019 @10:05PM (#20466045)
It shows up fairly frequently in pseudocode, especially for BNF syntax rules. I also (probably as a result) have come across it often-ish in embedded DSLs if the host language already uses = for assignment.

So from the perspective of Python as executable pseudocode it makes some sense.

Re:What's Coming in Python 3.8 by CraneWorm on Wednesday July 17, 2019 @06:22PM (#20464637)
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 by kxrm on Wednesday July 17, 2019 @06:29PM (#20464691)
Delphi uses this as an assignment operator but it certainly isn't a popular choice in most mainstream languages.
Re:What's Coming in Python 3.8 by girzel on Wednesday July 17, 2019 @06:43PM (#20464788)
Re:What's Coming in Python 3.8 by thestoicattack on Wednesday July 17, 2019 @05:42PM (#20464359)
In Ada, = is equals and := is assignment.
Re:What's Coming in Python 3.8 by abraae on Wednesday July 17, 2019 @05:40PM (#20464334)
Oracle's PL/SQL uses it. I believe it was based on ADA... googles ... Yes ADA uses it as well.
Re:What's Coming in Python 3.8 by queensnake on Wednesday July 17, 2019 @05:37PM (#20464318)
It looks to me like it could be an assignment to const, or, a copy vs a non-copy - it’s not obvious at all. I’m sure: ‘?=‘ was fought over and rejected, but that’s what I’d have expected conditional assignment to look like.
Re:What's Coming in Python 3.8 by xaedes on Wednesday July 17, 2019 @05:47PM (#20464398)
It is not "conditional assignment" tho. It is an assignment which returns the assigned value. You can use it in conditions, but you can also use it elsewhere.
Re:What's Coming in Python 3.8 by sleavey on Wednesday July 17, 2019 @05:23PM (#20464173)
It's not in a language I've ever used (furthermore, I explicitly mentioned beginners in my comment).
Re:What's Coming in Python 3.8 by coldtea on Wednesday July 17, 2019 @05:27PM (#20464218)
Well, beginners wont know generators, list comprehensions, asyncio, keyword arguments, and tons of other things either...