[Python-ideas] Indentation, again: Problems with moving and combining code across editors.
Mark Lawrence
breamoreboy at yahoo.co.uk
Fri Aug 29 21:40:02 CEST 2014
On 29/08/2014 20:12, Milind Khadilkar wrote:
> Hi!
> 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.
> Besides, spaces become difficult to count and distinguish from tabs,
> adding to the problem. (Why allow tabs at all?)
>
> Why can't Python be made to accept the following indentation of code (in
> *addition* to the current schemes)? There could be some flexibility of
> choosing the indentation character. (Pipe was mentioned as an
> alternative in another thread)
>
> for i in range(10):
> .if i>5:
> ..print 10-i
> .else:
> ..print i
> print "!"
>
> If not in the interpreter for some reason, could it be "advised" as a
> mode in a python oriented editor, or a "dictated" mechanism for
> copy/paste/transfer of code?
>
> Sorry for posing an elementary question.
>
> Thanks and regards
> MK-zedobject
>
It strikes me that these "problems" has existed for 23 years and somehow
people have survived. Could it be a classic example of a bad workman
always blames his tools? See Skip Montanaro's reply for an explanation
as to why.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
More information about the Python-ideas
mailing list