Clarifying a bit on commented code

This commit is contained in:
guibog
2012-04-27 21:40:25 +08:00
parent 3f9300b5da
commit 61e948e887
+13 -1
View File
@@ -104,26 +104,38 @@ line. Good editors allow to do this with few keystrokes (ctrl-v on Vim).
def tricky_function():
'''
Commented out because its breaks something.
if foo:
do_bar()
'''
return baz
def tricky_function():
# Commented out because its breaks something.
#if foo:
#do_bar()
return baz
def tricky_function():
# Commented out because its breaks something.
# if foo:
# do_bar()
return baz
**Good**
.. code-block:: python
def tricky_function():
# Commented out because its breaks something.
#if foo:
# do_bar()
return baz
Note that comment text is properly written and separated from the hash by a
space. Commented code is not separated from the hash by an additional space;
this helps when uncommented the code.
The Basics
::::::::::