Replace zip(d.keys(), d.values()) with d.items()

Proprietary

When both .keys() and .values() are zipped together, replace with .items() which yields key-value pairs directly. Only a zip that a for-loop or comprehension iterates directly is replaced, and only where the receiver is a name or attribute read whose type resolves to dict. A zip holding comments is left alone.

org.openrewrite.python.cleanup.UseItemsForKeyValueIteration
mod run . --recipe=org.openrewrite.python.cleanup.UseItemsForKeyValueIteration

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.