python 命名规范最近遇到的问题

mac2022-06-30  18

1.remove redundant parentheses

 出去多余的括号,写C#习惯了先加个括号,python的if不用加括号。

改为:if chrome_args().get("headless_flag") == "1":

2.Instance attribute xxx defined outside init

所有的属性都应该定义在init里面。

3.too broad exception clause

就是字面含义,你捕获的异常过于宽泛了,没有针对性,可以通过指定精确的异常类型来解决

 

转载于:https://www.cnblogs.com/c-x-a/p/8461283.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)