[ python-Feature Requests-1237680 ] add dedent() string method
SourceForge.net
noreply at sourceforge.net
Thu Sep 15 07:45:38 CEST 2005
Feature Requests item #1237680, was opened at 2005-07-13 18:48
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237680&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: add dedent() string method
Initial Comment:
textwrap.dedent() is very useful for in-code multi-line
string literals. However, as it is "hidden" in a module
it does not really fit in, people don't use it and
instead propose new string literal syntax for "dedented".
str.dedent with an efficient C implementation would
solve this.
----------------------------------------------------------------------
>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-15 07:45
Message:
Logged In: YES
user_id=1188172
Rejected as per discussion on python-dev.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2005-07-13 23:53
Message:
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1237680&group_id=5470
More information about the Python-bugs-list
mailing list