2to3 . --fix dict -wpn Py2 dict was a list by default, the iterator versions were switched around to be the default. This lets you have the old behavior. Mechanical. Ref: PEP 3106 https://peps.python.org/pep-3106/