Hacker News new | ask | show | jobs
by arketyp 2904 days ago
I feel the colon is unnecessary, especially considering how C deals with this. A plain '=' inside a conditional is already invalid syntax in Python.
2 comments

And it's a very well-known source of bugs in C, since it's to close to "==". I don't think new languages adopting that is a good idea.
Sure. But if fidelity to C style was not a concern then I don't see why the '==' syntax was adopted in the first place.
== is an incredibly common syntax for equality and stand-alone not a problem. only if you introduce = to expressions too it becomes a risk. (well, you could theoretically accidentally write == for a normal assignment, but that kind of error is caught more easily)
No, it's necessary.
How so? Syntactically, or from a pragmatic point of view?