This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients georg.brandl, inkerman, pitrou, roippi, serhiy.storchaka
Date 2014-11-11.19:42:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1415734956.32.0.119801832462.issue22687@psf.upfronthosting.co.za>
In-reply-to
Content
Unfortunately there are two disadvantages:

1. wordsep_re and wordsep_simple_re are public attributes and user code can depend on this. Changing their is a way to customize TextWrapper.

2. This is slowdown common case (no abnormally long words):

$ ./python -m timeit -s 'import textwrap; s = "abcde " * 10**4' -- 'textwrap.wrap(s)'

Unpatched: 178 msec per loop
Patched: 285 msec per loop

First reason stopped me from writing a patch.

When change the way how to split words, I suggest to use undocumented re scanner.
History
Date User Action Args
2014-11-11 19:42:36serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, pitrou, roippi, inkerman
2014-11-11 19:42:36serhiy.storchakasetmessageid: <1415734956.32.0.119801832462.issue22687@psf.upfronthosting.co.za>
2014-11-11 19:42:36serhiy.storchakalinkissue22687 messages
2014-11-11 19:42:36serhiy.storchakacreate