Does Python have a built-in function for unindenting a multiline string?

Not a built-in function, but a function in the standard library: textwrap.dedent()

>>> print(textwrap.dedent(s))

Controller = require 'controller'

class foo
    view: 'baz'
    class: 'bar'

    constructor: ->
        Controller.mix @

Leave a Comment