On 02/13/2014 02:13 PM, Chris Angelico wrote:
On Fri, Feb 14, 2014 at 8:33 AM, Ethan Furman <et...@stoneleaf.us> wrote:
Oh, it's not that bad!  All you have to do is handle the edge case of an
empty string:

s[::len(s)-1 if s else True]

And the edge case of the one-character string.

Oops, my description should have said "edge case of a one-character string".  
The empty string needs no extra handling.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to