refactoring

How to avoid nested "with" statements when working with multiple files in Python

How to avoid nested "with" statements when working with multiple files in Python Question: When working with multiple files in Python code can get ugly when using the recommended style: with open(“foo.txt”) as foo: with open(“bar.txt”, “w”) as bar: with open(“baz.txt”, “w”) as baz: # Read from foo, write different output to bar an baz …

Total answers: 1

Any pointers on using Ropevim? Is it a usable library?

Any pointers on using Ropevim? Is it a usable library? Question: Rope is a refactoring library for Python and RopeVim is a Vim plugin which calls into Rope. The idea of using RopeVim seems great to me, is there any documentation on “getting started” with RopeVim? I’ve followed what documentation there is: https://bitbucket.org/agr/ropevim/src/tip/README.txt I suppose …

Total answers: 4

How can you find unused functions in Python code?

How can you find unused functions in Python code? Question: So you’ve got some legacy code lying around in a fairly hefty project. How can you find and delete dead functions? I’ve seen these two references: Find unused code and Tool to find unused functions in php project, but they seem specific to C# and …

Total answers: 5