[Python-Dev] Alternative implementation of interning

Guido van Rossum guido@python.org
Thu, 15 Aug 2002 12:20:37 -0400


Again: python/sf/576101

I'd like to make all interned strings mortal; this allows some
simplifications to the patch.  This would mean that in the following
example:

  x = intern('12345'*4)
  nx = id(x)
  del x
  ...do something else...
  y = intern('12345'*4)
  ny = id(y)

nx doesn't necessarily equal ny any more.  This is a backward
incompatibility but I'm willing to break programs that rely on this;
it sounds highly unlikely that the author of any such code as exists
would mind it being broken.

Opinions?

(Reminder: this is python-dev, not types-sig. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)