Apply De Morgan's law to any(not ...)/all(not ...)
ProprietaryWhen the generator body just negates the loop variable, De Morgan's law lets us eliminate the generator entirely: any(not v for v in seq) becomes not all(seq), and the reverse. It only fires where any and all resolve to the builtins.
org. openrewrite. python. cleanup. InvertAnyAllBodymod run . --recipe= org. openrewrite. python. cleanup. InvertAnyAllBodyInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.