Set class that keeps weak references to its elements. An element will be discarded when no strong reference to it exists any more.
weakref/WeakSet
WeakSet