Fix the default placeholder in textwrap.shorten() to be " [...]".

For some reason I forgot to do it before committing the patch in issue #18585.
This commit is contained in:
Antoine Pitrou 2013-08-16 22:31:12 +02:00
parent 05eafa887b
commit c593056744
3 changed files with 11 additions and 11 deletions

View file

@ -19,7 +19,7 @@ __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# since 0xa0 is not in range(128).
_whitespace = '\t\n\x0b\x0c\r '
_default_placeholder = ' (...)'
_default_placeholder = ' [...]'
class TextWrapper:
"""
@ -376,7 +376,7 @@ def shorten(text, width, *, placeholder=_default_placeholder, **kwargs):
>>> textwrap.shorten("Hello world!", width=12)
'Hello world!'
>>> textwrap.shorten("Hello world!", width=11)
'Hello (...)'
'Hello [...]'
"""
w = TextWrapper(width=width, **kwargs)
return w.shorten(text, placeholder=placeholder)