Out-denting multiline comments

Max M maxm at mxm.dk
Tue Aug 20 09:41:44 CEST 2002


Ville Vainio wrote:



> I'm still wondering about the handling of the first line: at the
> moment, I would be inclined to remove it, if it only has whitespace,
> and process normally otherwise. That would be different from
> inspect.getdoc, but less magical/special.


I think that would be a good idea. The main idea of outdenting multiline 
strings is to achieve better formatting of the source code.

And a is a lot more readable than b::

     a = """
         This is an example
         of multiline text:
             with indentation
         """

     b = """This is an example
     of multiline text:
         with indentation
     """

regards Max M




More information about the Python-list mailing list