Y
Hacker News
new
|
ask
|
show
|
jobs
by
aviraldg
2905 days ago
It also seems include a special case for if/while that lets you do:
def foo(): if randint(0, 3) as n: return n ** 2 return 1337
which looks a bit better to me.
2 comments
icebraining
2905 days ago
I think that's a rejected alternative proposal, not part of this PEP.
link
s3m4j
2905 days ago
https://www.python.org/dev/peps/pep-0572/#alternative-spelli...
link