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/2002-July/026134.html below:

Alternative implementation of string interni ng

[Python-Dev] Re: Alternative implementation of string interni ng [Python-Dev] Re: Alternative implementation of string interni ngDelaney, Timothy tdelaney@avaya.com
Wed, 3 Jul 2002 17:17:54 +1000
> From: Oren Tirosh [mailto:oren-py-d@hishome.net]
> 
> > Oren Tirosh wrote:
> > > alias for this type.  No two istr instances are equal 
> unless they are
> > > identical.  I guess PyString_CheckExact would need to be 
> 
> you assuming
> that == would be equivalent to 'is' for istrs?  The == 
> operator should work 
> exactly the same, just possibly a little faster when 
> comparing two istrs.
> 
>   (type(s) is istr and type(t) is istr and s == t) implies (s is t).

Do you mean that comparing two instances of istr would use *is*, but
comparing an istr with any other instance would use the normal str compare?
Because that is not how it has come across.

My first thought when I saw this proposal was "neat". My second was "yuk".

The #1 most important consideration here is backwards compatibility IMO.
Whilst I would be personally unaffected by this change (allowing interned
strings to be collected), we've already had examples of people and code that
would be.

Tim Delaney




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