textwrap.dedent replaces tabs?

Peter Otten __peter__ at web.de
Sun Dec 17 02:57:49 EST 2006


Tom Plunket wrote:

> I guess I could manually replace all tabs with eight
> spaces (as opposed to 'correct' tab stops), and then replace them when
> done, but it's probably just as easy to write a non-destructive dedent.

You mean, as easy as

>>> "\talpha\tbeta\t".expandtabs()
'        alpha   beta    '

?

Peter




More information about the Python-list mailing list