import ctypes
AwfulHackToGetTheInternedDict = ctypes.pythonapi.AwfulHackToGetTheInternedDict
AwfulHackToGetTheInternedDict.argtypes = ()
AwfulHackToGetTheInternedDict = ctypes.py_object
interned = AwfulHackToGetTheInternedDict()
How to determine the number of interned strings in Python 2.7.5?