News for hackers. Stuff that matters.
Re:PEP 572: Python assignment expressions has been accepted by aib on Wednesday July 04, 2018 @07:44AM (#17456653)
> > Add to that the brokenness of if...else

> Could you elaborate on that?

It's a very opinionated statement on my part. `if COND then TRUE-CASE else FALSE-CASE` is the correct form to use, in my opinion. Python uses `TRUE-CASE if COND else FALSE-CASE`.

Re:PEP 572: Python assignment expressions has been accepted by hellofunk on Thursday July 05, 2018 @01:25PM (#17465074)
Conventional if statements in Python do use your preferred form of `if COND then TRUE-CASE else FALSE-CASE`.

What you are talking about is a different kind of expression, similar to a ternary operator. It is not the same as if...else

Re:PEP 572: Python assignment expressions has been accepted by aib on Thursday July 05, 2018 @06:38PM (#17467465)
The reason it's not the same as if...else is that it's freaking backwards :D
Re:PEP 572: Python assignment expressions has been accepted by hellofunk on Friday July 06, 2018 @04:53AM (#17469932)
You said:

> Python uses `TRUE-CASE if COND else FALSE-CASE`.

And this is wrong -- this is not how Python if statements work.

Re:PEP 572: Python assignment expressions has been accepted by aib on Friday July 06, 2018 @08:20AM (#17470775)
> > Python uses `TRUE-CASE if COND else FALSE-CASE`.

> And this is wrong -- this is not how Python if statements work.

Huh? Didn't you yourself say I was not talking about if statements:

> What you are talking about is a different kind of expression, similar to a ternary operator. It is not the same as if...else

In any case, I'm talking about the case that goes `TRUE-CASE if COND else FALSE-CASE`, as can be deduced from my typing `TRUE-CASE if COND else FALSE-CASE`.