Remove Pass From Body
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery refactoring id: remove-pass-body
Section titled “Sourcery refactoring id: remove-pass-body”Description:
Section titled “Description:”Removes a pass from the body of a conditional by inverting it
Before:
Section titled “Before:”if not a: passelse: return cAfter:
Section titled “After:”if a: return cExplanation:
Section titled “Explanation:”It is much clearer for a conditional to do something in its main body than
solely in its else clause. In the latter case anyone reading the code has to
mentally invert the condition in order to determine the meaning.