[Idle-dev] IDLE comments

Guido van Rossum guido at python.org
Sat Jun 20 17:17:37 CEST 2009

On Sat, Jun 20, 2009 at 7:35 AM, Michael Foord<fuzzyman at voidspace.org.uk> wrote:
> Tal Einat wrote:
>> Jason Gervich wrote:
>>> Why does IDLE use two hash marks for comments (##)? Most other editors
>>> (Geany, SPE) use a single hash mark (#) to designate comments.
>> I actually don't know. I find that it's rather useful since I usually
>> use the commenting function to comment out blocks of code, and having
>> these commented with "##" differentiates them from comments which I
>> write manually.
> +1 this is exactly how I use it.

And this is how it's meant to be used. Quickly comment or uncomment a
section of code. Invaluable.

PS. Emacs does this too. I think there it was invented by Tim Peters.
It is done so that the auto-indent functionality *ignores* the
indentation of comments starting with ##, but assumes that comments
starting with #+space are meant to align up properly with the
surrounding code. (I don't know if IDLE uses this rule too.)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the IDLE-dev mailing list