Closed cclauss closed 5 years ago
@cclauss This code use python 2.7 for testing.
These undefined names remain the same in both Python 2 and Python 3.
The author just remain the definition of TreeNode commented, and this's kind of lc style.
You will see more in Leetcode_Solution/Python part.
The more Pythonic style might be:
class TreeNode:
raise NotImplementedError('Please add your implementation here...')
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
https://docs.python.org/3/library/exceptions.html#NotImplementedError
flake8 testing of https://github.com/apachecn/awesome-algorithm on Python 3.7.1
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
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.
name
name
in__all__