[issue18335] Add textwrap.dedent, .indent, as str methods.
Martin Panter added the comment: If this goes ahead, would a bytes.dedent() method be also considered? I recently discovered that textwrap.dedent() does not work on bytes() in Python 3. I would have used it for the contents of an input file in a test case. For the record there’s an older issue 1237680 on this, rejected in 2005. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Antoine Pitrou pit...@free.fr: -- stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Nick Coghlan added the comment: It turns out there's one slight wrinkle in this grand plan: it won't work for docstrings without some additional tweaking to allow for method calls in the docstring detection. def f(): ... example.lower() ... print(f.__doc__) None import dis dis.dis(f) 2 0 LOAD_CONST 1 ('example') 3 LOAD_ATTR0 (lower) 6 CALL_FUNCTION0 (0 positional, 0 keyword pair) 9 POP_TOP 10 LOAD_CONST 0 (None) 13 RETURN_VALUE -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Nick Coghlan added the comment: I still think the methods are worth adding regardless - I just anticipate a request to allow method calls on docstrings to follow not long after ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Serhiy Storchaka added the comment: str already have too many methods. Who uses str.swapcase() or str.zfill() now? I'm -0.5 for adding any new str methods. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Barry A. Warsaw added the comment: .dedent() is a no-brainer. JFDI. +1 .indent() I guess makes sense for symmetry, although I've rarely used it. -0 As for docstrings, I can imagine other alternatives, so let's let someone interested in that go through the PEP process. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Éric Araujo added the comment: IMO it’s fine that docstrings continue to live as pure string literals, and documentation tools continue to follow PEP 257’s advice. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
New submission from Terry J. Reedy: To end proposals for new syntax to do what they do for triple-quoted strings. Nick Coghlan gave reasons as follows: run time cost small, can be optimized away, would be used more than some other string methods. http://mail.python.org/pipermail/python-ideas/2013-July/021717.html In response, Guido said That's a compelling argument. Let's do it. http://mail.python.org/pipermail/python-ideas/2013-July/021718.html -- messages: 192109 nosy: ncoghlan, terry.reedy priority: normal severity: normal stage: test needed status: open title: Add textwrap.dedent, .indent, as str methods. type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18335] Add textwrap.dedent, .indent, as str methods.
Changes by SpaghettiToastBook spaghettitoastb...@gmail.com: -- nosy: +SpaghettiToastBook ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com