Hacker News new | past | comments | ask | show | jobs | submit login

For Python specifically, the colon is always used to introduce a block, which makes parsing somewhat easier as well as being consistent throughout the language.

However, one could easily imagine a design where certain keywords automatically introduce a block after the current line, which would eliminate the need for the colon. It would prevent one-liners (e.g. “if x: y”) but that’s no big loss. The colon would continue to be used for e.g. lambda, dict and annotation syntax.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: