5 ms·
I feel the colon is unnecessary, especially considering how C deals with this. A plain '=' inside a conditional is already invalid syntax in Python.
by arketyp 8y 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.
- heavenlyblue 8y agoNo, it's necessary.
- arketyp 8y agoHow so? Syntactically, or from a pragmatic point of view?
- detaro 8y agoAnd 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.
- arketyp 8y agoSure. But if fidelity to C style was not a concern then I don't see why the '==' syntax was adopted in the first place.
- detaro 8y ago== 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)