←back to thread

317 points est | 1 comments | | HN request time: 0.212s | source
Show context
oooooof ◴[] No.17448560[source]
What is it? The link points to a discussion more deep than I’m willing to read.
replies(10): >>17448567 #>>17448570 #>>17448571 #>>17448572 #>>17448575 #>>17448579 #>>17448584 #>>17448591 #>>17448617 #>>17448638 #
kibibu ◴[] No.17448591[source]
High-level overview: it's an assignment operator that returns its value, similar to C's assignment operator.

The choice of := is to avoid accidentally using assignment where comparison is expected.

replies(2): >>17448770 #>>17453569 #
arketyp ◴[] No.17448770[source]
I feel the colon is unnecessary, especially considering how C deals with this. A plain '=' inside a conditional is already invalid syntax in Python.
replies(2): >>17448792 #>>17448811 #
heavenlyblue ◴[] No.17448792[source]
No, it's necessary.
replies(1): >>17448898 #
1. arketyp ◴[] No.17448898[source]
How so? Syntactically, or from a pragmatic point of view?