Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Undefined name 'line' in text2bin.py #9

Open
cclauss opened this issue Dec 4, 2018 · 0 comments
Open

Undefined name 'line' in text2bin.py #9

cclauss opened this issue Dec 4, 2018 · 0 comments

Comments

@cclauss
Copy link
Contributor

cclauss commented Dec 4, 2018

https://github.com/IBM/MAX-Word-Embedding-Generator/blob/master/text2bin.py#L73

Python 2's scoping rules would allow line to be visible after the list comprehension was completed but Python 3's scoping rules do not allow this.

flake8 testing of https://github.com/IBM/MAX-Word-Embedding-Generator on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./text2bin.py:73:58: F821 undefined name 'line'
        if any(part[0] != token for part in parts[1:] or line[0] == ''):
                                                         ^
1     F821 undefined name 'line'
1
cclauss added a commit to cclauss/MAX-Word-Embedding-Generator that referenced this issue Jun 6, 2019
Automates the discovery of IBM#9 and other problems.
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