A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068654.html below:

[Python-Dev] Fwd: Problem withthe API for str.rpartition()

[Python-Dev] Fwd: Problem withthe API for str.rpartition()David Hopwood david.nospam.hopwood at blueyonder.co.uk
Wed Sep 6 03:08:03 CEST 2006
Barry Warsaw wrote:
> The bias with these terms is clearly the English left-to-right  
> order.  Actually, that brings up an interesting question: what would  
> happen if you called rpartition on a unicode string representing  
> Hebrew, Arabic, or other RTL language?  Do partition and rpartition  
> suddenly switch directions?

What happens is that rpartition searches the string backwards in logical
order (i.e. left to right as the text is written, assuming it only contains
Hebrew or Arabic letters, and not numbers or a mixture of scripts). But this
is not "switching directions"; it's still searching backwards. You really
don't want to think of bidirectional text in terms of presentation, when
you're doing processing that should be independent of presentation.

> If not, then I think left-sep-right are fine.  If so, then yeah, we  
> probably need something else.

+1 for (upto, sep, rest) -- and I think it should be in that order for
both partition and rpartition.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4