4 ms·
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
by aviraldg 8y 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.
- icebraining 8y agoI think that's a rejected alternative proposal, not part of this PEP.
- s3m4j 8y agohttps://www.python.org/dev/peps/pep-0572/#alternative-spellings https://www.python.org/dev/peps/pep-0572/#alternative-spelli...