← All recipes
Moderne licensed

Find functools.cmp_to_key() usage

Recipe IDorg.openrewrite.python.migrate.FindFunctoolsCmpToKeyArtifactopenrewrite-migrate-python

Find usage of functools.cmp_to_key() which is a Python 2 compatibility function. Consider using a key function directly.

Single recipepythonfunctoolscode-qualityProprietary

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.migrate.FindFunctoolsCmpToKey

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

mod config recipes pip install openrewrite-migrate-python