← All recipes
Moderne licensed

Flatten redundant collection constructor wrapping a literal

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

When tuple(), list(), or set() wraps a single list or tuple literal, remove the constructor and use the target literal form directly.

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.UnwrapIterableConstruction

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

mod config recipes pip install openrewrite-static-analysis