[Patches] [ python-Patches-598163 ] textwrap.dedent, inspect.getdoc-ish

noreply@sourceforge.net noreply@sourceforge.net
Wed, 04 Sep 2002 06:43:39 -0700


Patches item #598163, was opened at 2002-08-21 05:39
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=598163&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Ville Vainio (vvainio)
Assigned to: Greg Ward (gward)
Summary: textwrap.dedent, inspect.getdoc-ish

Initial Comment:
Ability to remove indentation from multiline strings
(often triple-quoted). Differs from inspect.getdoc by
not handling the first line in special manner (often a
sensible approach for non-docstring multiline strings)
- which should make this function more general
(symmetric 'indent' also possible), and more fitting
for the textwrap module.

Implementation is for the most parts familiar from
inspect.getdoc, though I used sring methods instead of
the module 'string'.

The module 'textwrap' and the function name 'dedent'
were suggested on python-dev a while back (by MAL, IIRC).



----------------------------------------------------------------------

>Comment By: Greg Ward (gward)
Date: 2002-09-04 09:43

Message:
Logged In: YES 
user_id=14422

Looks fine to me.  Can you provide a patch for 
Doc/lib/libtextwrap.tex as well?  A patch to 
Lib/test/test_textwrap.py would be nice too, but I can take care 
of that if you prefer.

(Any other diffs should just be uploaded to this patch report.)

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-09-03 14:57

Message:
Logged In: YES 
user_id=6380

For Greg Ward.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=598163&group_id=5470