commenting out blocks of code

Cameron Laird claird at lairds.us
Fri Feb 17 21:08:02 EST 2006


In article <mailman.2076.1140221235.27775.python-list at python.org>,
Paul McNett  <p at ulmcnett.com> wrote:
			.
			.
			.
>IMO this is a missing feature in Python. However, if the block of code 
>you are wanting to comment out doesn't happen to contain any 
>triple-quotes, you can surround the code with those. For example:
>
>def myFunc(arg):
>	return arg + 2
>
>"""
>def myFunc(arg):
>	return arg + 1
>"""
>
> >>> print myFunc(2)
>4
			.
			.
			.
... and note that, even if the block *does* contain triple-quotes
of one flavor, you can use the other:

  '''This is syntactic data:  """.

  '''



More information about the Python-list mailing list