2013/7/1 Guido van Rossum guido@python.org

That‘s a compelling argument. Let’s do it. (Assuming the definition of
exactly how to indent or dedent is not up for discussion — if there
are good reasons to disagree with textwrap now's the time to bring it
up.)

I don’t know if it’s a good reason, but I’m of the opinion that the required backslash at the beginning of to-be-dedented string is strange:

We try to eliminate escaped newlines elsewhere (e.g. bracing import statements, conditions and tuple values is preferred to escaping newlines)

I think dedent (or however it’s going to be called) should remove common whitespace and, if the first line is completely empty, that first line as well.

Also for your consideration would be scala’s way:

"""|spam
   |eggs""".stripMargin() == "spam\neggs"

"""#spam
   #eggs""".stripMargin('#') == "spam\neggs"

i.e. removal of all leading whitespace up to and including a margin character/prefix. It could be a kwarg to “dedent”…