[Python-ideas] Suggestion: Integrate the script "pindent.py" as standard command for formatting pyhton code

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 27 01:28:47 CEST 2011


Serge Hulne wrote:

> It is my feeling that without such a tool Python is inherently very 
> vulnerable to glitches occurring at editing time:
> 
>          1. Copy / paste glitch that passes unnoticed, does not generate
>             an exception but alters the logic of the program.
>          2. Tab key inadvertently hit.
>          3. Difficulty in assessing the target indentation level when a
>             part of a bloc has to be pasted in a different part of the
>             code.

How much actual experience have you had writing and editing
Python code? While it might seem from a theoretical viewpoint
that these problems should exist, in my experience they occur
very rarely, if at all.

Even sending Python code by email seems to be fine most of
the time as long as you indent it with spaces, unless there
is some particularly braindamaged piece of software in the
way. All the Python mailing lists and newsgroups I frequent
seem to handle space-indented Python just fine.

I don't think any tool to add block-delimiting comments is
going to gain much adoption, because the uglification of the
code that it results in is grossly out of proportion to the
actual magnitude of the problem.

-- 
Greg



More information about the Python-ideas mailing list