Here's pyunparse 0.2. Mostly cosmetic improvements, but I'm not so ashamed of the code, and it should be easier to grok and modify. Please download it if you are using the old version.
Michael Spencer writes (in comments below):
I use compiler.ast for local-context-aware code-completion. I had wondered about adding some refactoring at least in the trivial sense of creating local bindings to eliminate global lookups or frequently-used attribute lookups. Your un-parser would help here, since I'd want the changes reflected in the source.
That's also one of my use cases - some trivial optimizations and common refactorings. Rebind-locals for reference locality would be one optimization. Wrap-method , Move-Method-Up, Rename-class - some of the original Fowler refactorings should be possible too. If anyone has other suggestions, please leave a comment. |