Invert Any/All
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: invert-any-all
Section titled “Sourcery refactoring id: invert-any-all”Description:
Section titled “Description:”Switches not any or not all statements to all or any statements
respectively
Before:
Section titled “Before:”b = not all(a > b for a in things)After:
Section titled “After:”b = any(a <= b for a in things)Explanation:
Section titled “Explanation:”A negation is more difficult to read than a straightforward statement. This refactoring inverts the any or all to remove the negation.