Hacker News new | ask | show | jobs
by zem 448 days ago
python's use is the unusual one; the most common use (dating all the way back to algol) is to use it for assignment, so you can use = for equality.

https://en.wikipedia.org/wiki/Assignment_(computer_science)#...

1 comments

Go uses "==" for equality checks, "=" for assignments, and ":=" for "declaration/assignment with type inference" - so it's different from both Python (you can use ":=" as part of an expression in Go too, but you can also use "=") and Algol/Pascal (where it's used only for assignment).