Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
acjohnson55
on Nov 10, 2013
|
parent
|
context
|
favorite
| on:
Pyret: A new programming language from the creator...
But if indentation matters, and it's pressent, then why do you need the colon?
ptx
on Nov 10, 2013
[–]
Well, the colon can be used without indentation if the block that follows is just a single line:
def embiggen(x): return x * 2 for i in range(10): print(embiggen(x))
Also, it just makes things read more naturally to us humans, I think.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: