Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

List comprehension warning when using an already defined variable name #612

Open
jneuendorf opened this issue Jul 24, 2017 · 0 comments
Open

Comments

@jneuendorf
Copy link

jneuendorf commented Jul 24, 2017

Hey,

I just had an insane debug session because of something like this:

node = new Node()
# orgNode = node
node.props = (node.prop for node in siblings) # if siblings is not empty
# -> orgNode != node

Of course, after the list comprehension has been executed node is not the previously constructed node.
In Python the list comprehension would create a new namespace so this would work. As it does not behave the same in CoffeeScript I would really appreciate a warning about the name clash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant