Out-denting multiline comments
Gillou
nospam at bigfoot.com
Thu Aug 8 15:12:47 EDT 2002
thisShouldFit = ("\nName: %(name)s\n"
"age: %(age)s\n") % vars()
--Gilles
>>> from base64 import decodestring
>>> replyTo = decodestring('Z2xlbmZhbnRAYmlnZm9vdC5jb20=\n')
"Max M" <maxm at mxm.dk> a écrit dans le message de news:
3D52990F.80009 at mxm.dk...
> 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