[Python-Dev] Alternative implementation of interning, take 2

Tim Peters tim.one@comcast.net
Fri, 12 Jul 2002 17:33:18 -0400


[MAL]
> Sure, but SetItemString() does some extra magic: it interns the
> key for me.

As a directly interned string.  Indirect interning is irrelevant to this
benefit.

Don't argue about this, run the patched code <wink>:  it will tell you
directly whether ii is doing you any good.

> ...
> I only use PyString_InternInPlace() on strings which will be
> used as dict keys or for string compares in tokenizers and
> parsers.

Again it doesn't really matter when you call it; if the indirect interning
optimization is doing you any good, it will be because of stuff Python is
doing under the covers.