Feb. 12, 2007
8:29 p.m.
Hrvoje NikĀic <hrvoje.niksic@avl.com> wrote:
I propose modifying PyString_InternInPlace to better cope with string subtype instances.
Any particular reason why the following won't work for you? _interned = {} def intern(st): #add optional type checking here if st not in _interned: _interned[st] = st return _interned[st] If I remember the implementation of intern correctly, that's more or less what happens under the covers. - Josiah