A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-February/051745.html below:

[Python-Dev] textwrap wordsep_re

[Python-Dev] textwrap wordsep_re [Python-Dev] textwrap wordsep_reAahz aahz at pythoncraft.com
Tue Feb 22 15:35:06 CET 2005
On Mon, Feb 21, 2005, Karl Chen wrote:
>
> A slightly tweaked wordsep_re:
>     textwrap.TextWrapper.wordsep_re = \
>         re.compile(r'(\s+|'                  # any whitespace
>                    r'[^\s\w]*\w+[a-zA-Z]-(?=[a-zA-Z]\w+)|' # hyphenated words
>                    r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')   # em-dash
>     print textwrap.fill('aaaaaaaaaa 2005-02-21', 18)
> behaves better:
>     aaaaaaaaaa
>     2005-02-21
> 
> What do you think about changing the default wordsep_re?

Please post a patch to SF.  If you're not familiar with the process,
take a look at http://www.python.org/dev/dev_intro.html

Another thing: I don't know whether you'll get this in direct e-mail;
it's considered a bit rude for python-dev to use munged addresses.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code -- 
not in reams of trivial code that bores the reader to death."  --GvR
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4