unnecessary-return-none (RET501)
Added in v0.0.154 · Related issues · View source
Derived from the flake8-return linter.
Fix is always available.
What it does
Checks for the presence of a return None statement when None is the only
possible return value.
Why is this bad?
Python implicitly assumes return None if an explicit return value is
omitted. Therefore, explicitly returning None is redundant and should be
avoided when it is the only possible return value across all code paths
in a given function.
Example
Use instead:
Fix safety
This rule's fix is marked as unsafe for cases in which comments would be
dropped from the return statement.