[Python-ideas] Indentation, again: Problems with moving and combining code across editors.

Skip Montanaro skip at pobox.com
Fri Aug 29 21:24:59 CEST 2014


On Fri, Aug 29, 2014 at 2:12 PM, Milind Khadilkar <zedobject at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140829/5f7eec35/attachment.html>


More information about the Python-ideas mailing list