Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential loop variable fix #2987

Conversation

gokul-the-dev
Copy link

#2918 Looks like we have a potential accidental capture of loop variable in Boxer.

The fix removes the comprehensive list iteration to conventional loop.

@tomaarsen
Copy link
Member

I'm afraid this does not resolve the issue, I believe. Take for example the following program, with code that resembles your implementation.

conds = [1, 2, 3, 4, 5]

conda_result = []
for cond in conds:
    conda_result.append(lambda sent_index, word_indices: cond)

for func in conda_result:
    print(func(None, None))

outputs:

5
5
5
5
5

@stevenbird stevenbird closed this May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants