I guess when I considered myself a Pythonista I didn't ever notice how bonkers Python's scoping is
@cwebber *thinks with horror of list comprehension*
@Thib I haven't run into weird issues with list comprehension, but maybe if I looked again I'd realize them. But I think you could mostly do something with a list comprehension like interface using macros and lexical scope.
locals/globals though, what a weird design
@cwebber in Python 2, variables defined in list comprehensions escaped their scope, this has been fixed in Python 3.
e.g.,
foo = [x * y for x, y in enumerate(bar)]
would leak x and y in the remaining code