R. David Murray added the comment:

Looking just at the proposed functionality (taking a prefix) and ignoring the 
requested complexification :), the usual name for the text produced by this 
process is a "lead" 
(http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Lead_section), although 
formally a lead is actually written to be used as such, as opposed to just 
taking a prefix, so that word really has the same problem as 'summarize'.

I think 'truncate' would be a better name.  Or, if you don't mind being 
wordier, extract_prefix.  The fact that it is part of the textwrap module 
should be enough clue that the truncation happens at whitespace.  Truncate 
could also apply to the expanded version if you squint a little, if Antoine is 
interested in that.  On the other hand, the use case presented for that is not 
going to be served by this function anyway, since this function (being part of 
textwrap) breaks on whitespace...it shouldn't (IMO) elide text other than at 
whitespace.  If you want that functionality it belongs in some other module, I 
think.

The placeholder argument could alternatively be named 'ellipsis', but 
placeholder is certainly fine.

shorten would probably be better if you are going with the expanded version, 
but I like truncate.  It is probably significant that that is what the title of 
the issue calls it :)

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to