<snip> > You could create a dict with the string as the key and the object as the > value. </snip> This will create a strong reference to the object, which is (I'm assuming) undesired behavior.