[Python-Dev] textwrap.py

Aahz aahz@pythoncraft.com
Fri, 7 Jun 2002 11:15:05 -0400

On Fri, Jun 07, 2002, Guido van Rossum wrote:
> > It doesn't matter if it "makes sense"[1]! It's a widely known rule
> > that some people still insist upon.  I don't see anyone arguing you
> > should adopt the convention, just that people who follow the
> > convention should see it respected.
> True, but then there needs to be a way to enable/disable it, since
> even if you never use two spaces after a period, the rule can still
> generate them for you in the output: when an input sentence ends at
> the end of a line but the output sentence doesn't, the rule will
> translate the newline into two spaces instead of one.
> I vote to have it off by default.

How about a compromise?  If the algorithm discovers a sentence with two
or more spaces ending it, it goes into "two-space" mode; otherwise, it
defaults to one-space mode.  (I think fmt does this, but I'm not sure;
it's certainly the case that sometimes it preserves my spaces and
sometimes it doesn't, and I've never been able to figure it out
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I had lots of reasonable theories about children myself, until I
had some."  --Michael Rios