跳到内容

not-in-test (E713)

源自 pycodestyle linter。

修复总是可用的。

作用

检查使用 not {element} in {collection} 的成员资格测试。

为什么这不好?

使用 {element} not in {collection} 测试成员资格更具可读性。

示例

Z = not X in Y
if not X.B in Y:
    pass

建议改为

Z = X not in Y
if X.B not in Y:
    pass