[issue18585] Add a text truncation function

Ezio Melotti report at bugs.python.org
Mon Aug 5 16:41:28 CEST 2013


Ezio Melotti added the comment:

[...] and ASCII are fine with me.

> Perhaps there could be an argument controlling where to truncate
> (left, right or centre). A good use-case for the new Enums, perhaps? :-)

I wrote a similar function once and in addition to the width it had this feature too (defaulting on "center"), so it sounds like a reasonable addition to me.  Back then I was simply passing a "left"/"right"/"center" string -- not sure it's worth adding an enum for this (FWIW for text alignment there are 3 separate methods: ljust, center, and rjust).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18585>
_______________________________________


More information about the Python-bugs-list mailing list