Suggested refactor given
Sourcery - Simplify comparison to booleannot getattr(instance, 'returns_none', False)
Expected
No refactor suggestion
A falsey comparison is not the same as an is False comparison.
Using getattr with a default of False allows catching a case where the attr does in-fact exist, but returns None.
Given
When
getattr(instance, 'returns_none', False) is False
Then
Suggested refactor given
Sourcery - Simplify comparison to boolean
not getattr(instance, 'returns_none', False)
Expected
No refactor suggestion A falsey comparison is not the same as an
is False
comparison. Using getattr with a default of False allows catching a case where the attr does in-fact exist, but returns None.