[issue26214] textwrap should minimize number of breaks in extra long words

Serhiy Storchaka report at bugs.python.org
Fri Sep 4 13:11:56 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The code with nested wraps is awesome. But it does not work well.

>>> list(itertools.chain(*(wr(x, 5) for x in wr("123 123 1234567 12", width=5, break_long_words=False))))
['123', '123', '12345', '67', '12']

It is expected that '67' and '12' should be in the same line: '67 12'.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26214>
_______________________________________


More information about the Python-bugs-list mailing list