Flexible string representation, unicode, typography, ...

Roy Smith roy at panix.com
Fri Aug 31 08:43:55 EDT 2012


In article <503f8e33$0$30001$c3e8da3$5496439d at news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:

> On Thu, 30 Aug 2012 07:02:24 -0400, Roy Smith wrote:
> > Is the implementation smart enough to know that x == y is always False
> > if x and y are using different internal representations?
> 
> [...] There may be circumstances where two strings have different 
> internal representations even though their content is the same

If there is a deterministic algorithm which maps string content to 
representation type, then I don't see how it's possible for two strings 
with different representation types to have the same content.  Could you 
give me an example of when this might happen?



More information about the Python-list mailing list