python行长度有限制吗_Python的PEP8行长度限制是否适用于注释?

是的,这些指南适用于源代码中的所有行,包括注释。这是因为它们有助于设定编辑器宽度的期望值。如果行长度建议不适用于评论,您仍然需要滚动编辑器窗口才能阅读评论。在

PEP8仍然是一个准则,不是一个严格的法治,你可以随意忽略它。我建议你在任何与更广泛的人合作的地方都坚持这个原则,即使你们都有更大的屏幕。就我个人而言,我喜欢能够并排放置多个编辑器选项卡。在

在Facebook上,我们使用^{}来soft—强制行长度,容差为10%:B950: Line too long. This is a pragmatic equivalent of pycodestyle’s E501: it considers “max-line-length” but only triggers when the value has been exceeded by more than 10%. You will no longer be forced to reformat code due to the closing parenthesis being one character too far to satisfy the linter. At the same time, if you do significantly violate the line length, you will receive a message that states what the actual limit is. This is inspired by Raymond Hettinger’s “Beyond PEP 8” talk and highway patrol not stopping you if you drive < 5mph too fast. Disable E501 to avoid duplicate warnings.

义务免责声明:我为flake8 bugbear做贡献。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值