Out-denting multiline comments

Max M maxm at mxm.dk
Thu Aug 8 12:15:11 EDT 2002


I sometimes run into the problem of multiline comments destroying the 
look of my indentation:


thisPrintsBad = """
     Name: %(name)s
     age: %(age)s
""" % vars()

thisLooksBadInSource = """
Name: %(name)s
age: %(age)s
""" % vars()

Is there a standard idiom for un-tabbing, de-denting, un-denting (or 
whatever it's called) a blok of code so that::

"""
     regards
         Max M
"""

becomes:

"""
regards
     Max M
"""


regards Max M




More information about the Python-list mailing list