Python handles globals badly.
marko at pacujo.net
Fri Sep 11 13:59:20 CEST 2015
Antoon Pardon <antoon.pardon at rece.vub.ac.be>:
> I just don't get why people want to introduce special cases in python.
> Why allow such a construct only in while and if? Why not just allow
> it generally as an assignment expression?
> Why not allow:
> while (f(x) as fx) > 5:
> if check(nextvalue() as new):
Hey, I know, I know!... Let's allow:
while (fx = f(x)) > 5:
if check(new = nextvalue()):
Seriously, though, I share your distaste of special cases, Antoon. Only
I don't like too much syntax (just look at Perl). There's nothing wrong
fx = f(x)
if fx <= 5:
new = nextvalue()
More information about the Python-list