Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the nominal line length from 80 to 100 characters (effectively increasing the maximum length to 99 characters), provided that comments and docstrings are still wrapped at 72 characters.
根据PEP8:
在我看来,这是要遵守的主要规则。
除此规则外,PEP8还建议对齐括号,因此我将执行以下操作:
注意,我重命名了您的方法
report_results
,遵循推荐的小写字母加下划线。在79个字符是more of a guideline than a rule。在
另外,这一行只有77个字符长,所以您应该没事。但是,如果要将其拆分,可以使用隐式延续:
如果函数签名远远超过了所使用的字符限制,则表示函数的参数太多。在
相关问题 更多 >
编程相关推荐