Message231044
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. |
|
Date |
User |
Action |
Args |
2014-11-11 19:42:36 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, georg.brandl, pitrou, roippi, inkerman |
2014-11-11 19:42:36 | serhiy.storchaka | set | messageid: <1415734956.32.0.119801832462.issue22687@psf.upfronthosting.co.za> |
2014-11-11 19:42:36 | serhiy.storchaka | link | issue22687 messages |
2014-11-11 19:42:36 | serhiy.storchaka | create | |
|