[Python-Dev] interning string subclasses

Guido van Rossum guido@python.org
Tue, 11 Sep 2001 22:38:14 -0400


> Question:  Should we complain if someone tries to intern an instance of
> a string subclass?  I hate to slow any code on those paths.

I think in this case intern(s) should return intern(str(s)).  The fast
path checks ob_sinterned first, and that should always point to a real
string for a string subclass.

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