← All recipes
Moderne licensed

Simplify identity comprehension to list()/set() call

Recipe IDorg.openrewrite.python.cleanup.IdentityComprehensionArtifactopenrewrite-static-analysis

A comprehension that simply passes through each element unchanged is equivalent to calling list() or set() on the iterable.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.cleanup.IdentityComprehension

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-static-analysis