LEADS icon indicating copy to clipboard operation
LEADS copied to clipboard

Encourage Using `if not ...` Instead of `if ... is None` when Applicable

Open ATATC opened this issue 5 months ago • 0 comments

For example:

def plugin(self, key: str, plugin: Plugin | None = None) -> Plugin | None:
    if plugin is None:
        return self._plugins[key]
    self._plugins[key] = plugin
    plugin.on_load(self)

plugin is never treated as False when meaningful. It should be simply if not plugin.

ATATC avatar Jul 26 '25 18:07 ATATC