当我在一个只有一行的文件上运行 flake8 时:def O(): pass 我得到了以下错误,尽管函数运行得很好:
/tmp/a.py:1:5: E743 ambiguous function definition 'O'
为什么 flake8 失败了?为什么我不只是收到警告?
请您参考如下方法:
来自documentation :
Do not define functions named 'l', 'o', or 'i' (E743)
Functions namedI,O, andlcan be very hard to read. This is because the letterIand the letterlare easily confused, and the letterOand the number0can be easily confused.Change the names of these functions to something more descriptive.
Additional links
- https://www.python.org/dev/peps/pep-0008/#names-to-avoid
