[Python-ideas] Add Unicode-aware str.reverse() function?
paddy3118 at gmail.com
Sat Sep 8 12:41:33 EDT 2018
Thanks for your replies.
After reading them,, although I seem to have a brain freeze at the moment
cannot think of an algorithm; I think it plausible, just in the ASCII world
someone to want to iterate through characters in a string in reverse order
maybe to zip with another existing iterable that would otherwise need to be
reversed? If it shifted from ASCII to unicode then letters with their
characters would have to be reversed as a single character; but also
over as a single unicode "character" - another problem!
I thought so, I scratch the surface of unicode, and find a deep chasm
On Saturday, 8 September 2018 12:33:07 UTC+1, Paddy3118 wrote:
> I wrote a blog post
> a decade ago on extending a Rosetta Code task example
> <http://rosettacode.org/wiki/Reverse_a_string>to handle the correct
> reversal of strings with combining characters.
> On checking my blog statistics today I found that it still had a
> readership and revisited the code
> (and updated it to Python3.6)..
> I found that amongst the nearly 200 languages that complete the RC
> task,there were a smattering of languages that correctly handled reversing
> strings having Unicode combining characters,
> including Perl 6 <http://rosettacode.org/wiki/Reverse_a_string#Perl_6>
> which uses flip.
> I would like to propose that Python add a Unicode-aware *str.reverse *method.
> The problem is, I'm a Brit, who only speaks English and only very rarely
> dips into Unicode.* I don't know how useful this would be!*
> Cheers, Paddy.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas