Serhiy Storchaka added the comment: Here is a patch which is closer to current code but solves complexity issue and also fixes some bugs in current code.
$ ./python -c "import textwrap; print(textwrap.wrap('this-is-a-useful-feature', width=1, break_long_words=False))" ['this-', 'is-a', '-useful-', 'feature'] $ ./python -c "import textwrap; print(textwrap.wrap('what-d\x27you-call-it.', width=1, break_long_words=False))" ['what-d', "'you-", 'call-', 'it.'] ---------- versions: +Python 2.7, Python 3.4 Added file: http://bugs.python.org/file37188/wordsplit.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22687> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com