not-is-test (E714) 添加于 v0.0.28 · 相关问题 · 查看源码 源自 pycodestyle linter。 修复总是可用的。 作用 检查使用 not {foo} is {bar} 进行的标识比较。 为什么这不好? 根据 PEP8,使用 is not 来测试对象的标识更具可读性。 示例 if not X is Y: pass Z = not X.B is Y 建议改为 if X is not Y: pass Z = X.B is not Y