Vajrasky Kok added the comment:
Monsieur Pitrou, thanks for the explanation. Actually, IMHO I prefer, 'hello
(...)' should be the minimum words we can use not '(...)' because '(...)' does
not make any sense. But, anyway, it's your call. :)
Anyway, using your summarize2.patch:
>>> textwrap.summarize('hello world!', width=6)
'(...)'
>>> textwrap.summarize('hello world!', width=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ethan/Documents/code/python/cpython/Lib/textwrap.py", line 378,
in summarize
return w.summarize(text, placeholder=placeholder)
File "/home/ethan/Documents/code/python/cpython/Lib/textwrap.py", line 314,
in summarize
raise ValueError("placeholder too large for max width")
ValueError: placeholder too large for max width
Why? '(...)' is 5 characters only. I checked the patch and found out that the
placeholder is ' (...)' (with space) and you compare the width with the
placeholder.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue18585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com