pylint--info from google

发布时间:2016-12-6 8:58:34 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"pylint--info from google",主要涉及到pylint--info from google方面的内容,对于pylint--info from google感兴趣的同学可以参考一下。

When you want to use python . it is a good tools for you to find some issue.and you can run it before debug your source code.  ///-----------------informance from google.inc Run pylint over your code. Definition:pylint is a tool for finding bugs and style problems in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages like C and C++. Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious warnings should be fairly infrequent. Pros:Catches easy-to-miss errors like typos, using-vars-before-assignment, etc. Cons:pylint isn't perfect. To take advantage of it, we'll need to sometimes: a) Write around it b) Suppress its warnings or c) Improve it. Decision:Make sure you run pylint on your code. Suppress warnings if they are inappropriate so that other issues are not hidden. To suppress warnings, you can set a line-level comment: dict = 'something awful' # Bad Idea... pylint: disable=redefined-builtin pylint warnings are each identified by a alphanumeric code (C0112) and a symbolic name (empty-docstring). Prefer the symbolic names in new code or when updating existing code. If the reason for the suppression is not clear from the symbolic name, add an explanation. Suppressing in this way has the advantage that we can easily search for suppressions and revisit them. You can get a list of pylint warnings by doing pylint --list-msgs. To get more information on a particular message, use pylint --help-msg=C6409. Prefer pylint: disable to the deprecated older form pylint: disable-msg. Unused argument warnings can be suppressed by using `_' as the identifier for the unused argument or prefixing the argument name with `unused_'. In situations where changing the argument names is infeasible, you can mention them at the beginning of the function. For example: def foo(a, unused_b, unused_c, d=None, e=None): _ = d, e return a

上一篇:mac上终端起动MySQL的方法
下一篇:Hashtable与ConcurrentHashMap区别

相关文章

相关评论