Alex: > We are indeed sure (sadly) that list comprehensions leak control > variable names. Guido: > But they shouldn't. It can be fixed by renaming them (e.g. numeric > names with a leading dot). Aahz: > ?!?! When listcomps were introduced, you were strongly against [...] > Are you changing your position[...]? Guido: > Did I say it was a feature that > > L = [x for x in R] > print x > > would print the last item of R? Well, I don't care much about the history of what you may have said... let's get it out in the open: The fact that listcomps leak their variable (thus providing a handy name-binding expression for the evil-minded among us) is a BAD THING. I'd love to see that (mis)feature removed someday. I'd love to have that made possible by Guido's _immediately_ and _officially_ declaring it to be an unsupported (and deprecated) feature. Then maybe *someday* we could get rid of them. Even now, people are writing code that (ab)uses this, and making it ever harder to ever change this in the future. -- Michael Chermside
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4