Remove Pass From Elif
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-elif
Section titled “Sourcery refactoring id: remove-pass-elif”Description:
Section titled “Description:”Removes a pass from the elif section of a conditional
Before:
Section titled “Before:”if a: x()elif b: passelse: return cAfter:
Section titled “After:”if a: x()elif not b: return cExplanation:
Section titled “Explanation:”Reducing the number of branches in a conditional reduces the mental load of
reading and understanding it considerably. This simplification can be made where
an empty elif branch is immediately followed by the else.