Message193975
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. |
|
Date |
User |
Action |
Args |
2013-07-31 06:11:41 | vajrasky | set | recipients:
+ vajrasky, barry, georg.brandl, pitrou, ezio.melotti |
2013-07-31 06:11:41 | vajrasky | set | messageid: <1375251101.38.0.533334977762.issue18585@psf.upfronthosting.co.za> |
2013-07-31 06:11:41 | vajrasky | link | issue18585 messages |
2013-07-31 06:11:40 | vajrasky | create | |
|