13th April 2012 - 3 minutes read time
Python doesn't officially support multi-line comments, but there is a way of implementing the same functionality using an existing language construct. Single line comments in Python are written like this:
# This is a single line comment.
Multi-line comments are not officially supported in Python. That said, you can create the same effect in Python by using a multi-line string. Unless it is part of a docstring at the start of a class, function or module then it parsed into a string variable, but nothing is done with it.
'''
This is
a multiline
comment
'''
Because this is a multi-line string it is therefore parsed by Python, so you will need to be careful what you put in it.