Undefined name 'e' in adjacentList.py
cclauss opened this issue · comments
Christian Clauss commented
https://github.com/USTC-Resource/USTC-Course/blob/master/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/codes/mbinary/graph/adjacentList.py#L104-L112 Discovered via #8
flake8 testing of https://github.com/USTC-Resource/USTC-Course on Python 3.7.1
$ flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
./数据结构/codes/mbinary/graph/adjacentList.py:104:33: F821 undefined name 'e'
while arc.nextEdge!=e:
^
./数据结构/codes/mbinary/graph/adjacentList.py:112:41: F821 undefined name 'e'
while arc.nextEdge!=e:
^
2 F821 undefined name 'e'
2
E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
- F821: undefined name
name
- F822: undefined name
name
in__all__
- F823: local variable name referenced before assignment
- E901: SyntaxError or IndentationError
- E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
Heqin Zhu commented
Fixed. Thanks!