palindrome iteration

Jussi Piitulainen jpiitula at ling.helsinki.fi
Sat Aug 28 02:22:13 EDT 2010


Terry Reedy writes:
> On 8/27/2010 3:43 PM, Jussi Piitulainen wrote:
> > Dave Angel writes:
> 
> > There could easily be a .reverse() method on strings. It would return
> > the reversed string, like .swapcase() returns the swapcased string.
> 
> Could be, but the main use case seems to be for palindrome testing ;-)
> Given that slicing and reversed() can do the same thing, the need is thin.

The need is quite thin, but immutability of strings is not an issue,
just like there can be .swapcase() though strings are immutable. That
is all I am saying above.



More information about the Python-list mailing list