[Python-Dev] str.dedent

Raymond Hettinger raymond.hettinger at verizon.net
Thu Sep 15 03:29:41 CEST 2005


> some time ago, I proposed a string method "dedent" (which currently is
in
> the
> textwrap module). The RFE is at http://python.org/sf/1237680.
>> Any opinions? If I don't get positive comments, I'll reject it.

-1
Let it continue to live in textwrap where the existing pure python code
adequately serves all string-like objects. It's not worth losing the
duck typing by attaching new methods to str, unicode, UserString, and
everything else aspiring to be string-like. 
String methods should be limited to generic string manipulations.
String applications should be in other namespaces. That is why we don't
have str.md5(), str.crc32(), str.ziplib(), etc.
Also, I don't want to encourage dedenting as a way of life --- programs
using it often are likely to be doing things the hard way.
Raymond


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /