On Fri, Aug 29, 2014 at 2:12 PM, Milind Khadilkar <zedobject@gmail.com> wrote:
I do appreciate that indentation in Python code shows intention, and I am all for it, but problems do arise if code is copied from one place to another, even from specialized Python editors.... and there is little you can do to recover intentions/indentations lost in the process.
It's a known issue. I wouldn't necessarily call it a problem. I don't know if there are good strategies for tackling that other than "don't do that." If you find yourself copying around blocks of text which don't correspond to whole functions or classes, it tells me you might have some refactoring to do. Tools like pylint can help identify common chunks of code between two or more files. I don't know what support there is in existing editors or IDEs for code refactoring. There used to be Bicycle Repair Man, but I think he's long gone: http://bicyclerepair.sourceforge.net/ There is also a library called ROPE: http://rope.sourceforge.net/ Never heard of it before. Don't know if it's currently supported (it at least has Py3K support). Skip