Having moved from Perl to Python one of the things I miss is "Deparse". It not only reformats perl code, but it reduces the number of parens and even changes older features to equivalent newer features.
For example:
$ perl -MO=Deparse -e 'if (($x == $b) || ($foo == $bar )) { &thing };'
if ($x == $b or $foo == $bar) {
&thing;
}
-e syntax OK
Notice that it not just formats it, it removed unnecessary parens and turned older syntax (||
) to newer syntax (or
).
Is there anything similar for Python?