Will, I meant its usage on strings. Admittedly, it's probably not the best
thing to do.


On Wed, Dec 30, 2009 at 8:11 AM, Thomas K. Adamcik <tadam...@gmail.com>wrote:

> On Wed, Dec 30, 2009 at 08:04:47AM +0200, Jerome Leclanche wrote:
> > Users expect it to be called "truncate", that alone is sufficient reason.
> > There's truncate_html, truncate_words.
>
> Designers and others who are not familiar with Python might expect the
> 'truncate' name. While developers experienced with Python see this as list
> slicing, thus the 'slice' name.
>
> > Deprecate slice, move it to "truncate" and add the ellipsis for
> consistency.
> > No harm done, happy users.
>
> Renaming will thus only move the problem, what might come closer to real
> fix here
> is documenting that slice can be used as a truncate-filter.
>
> -Thomas Adamcik
>
>
As an experienced python developer, I don't expect a "slice" filter on
strings, just as much as I'd expect a getattr filter. If I do know about the
slice filter, yes, I'd expect it to work on strings.

Here is the real issue, people are asking for a truncate filter and have
been for at least two years. As I said, you just have to grep irc logs to
see just how often this comes up. You can't say "the situation is fine" and
not change anything. Docs have to be clarified, and to be honest I don't see
the actual harm in adding an additional truncate filter. There are other,
much less commonly-used filter which should move out of the core. Looking
randomly at the list, one example between ten would be phone2numeric.

Enough from me for now, late night (early morning) calls.

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.


Reply via email to