Hrvoje Nikšic <[EMAIL PROTECTED]> 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

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to