Single Pound # comments versus Double Pound ## comments

Mitch Chapman Mitch.Chapman at bioreason.com
Fri Oct 4 17:49:26 EDT 2002


Manuel M. Garcia wrote:
> In Python code, does anyone distinguish between starting comments with
> a single pound (#) or a double pound (##)?
> ActivePython colorizes them differently (# - green, ## - gray), and
> not understanding the distinction implied is bugging me.

When using python-mode for Emacs, if you elect to "Comment Region"
then double-pound signs are inserted.  If you elect to "Uncomment
Region" then only those lines beginning with a double-pound are
uncommented.  So perhaps the lines are highlighted differently on the
assumption that double-pound lines contain "disabled" code.

-- 
Mitch Chapman
Mitch.Chapman at bioreason.com




More information about the Python-list mailing list