Issue 1237680: add dedent() string method (original) (raw)
Logged In: YES user_id=80475
-1
Being a top level function in a module doesn't count as hidden. This is no more hidden than collections.deque, glob.glob, or re.sub.
The API requirements are looser in a textwrap context. For a string method, there would need to be a universally useful decision about how to handle mixed spaces and tabs and whether the first line of a triple-quoted string would be handled differently. Am not sure if universal newlines present any additional issues.
The world-view of the string module is character oriented, not line oriented. A dedent method() is not a perfect fit.
While the topic comes up every few years, in general, there is no user demand for this.