Hello, Has anyone ever think about a set wich references its elements weakly ? The *easy* solution would provide a WeakSet class with the following behavior: >>>s=set([a, b]) >>>ws=WeakSet([b,c]) >>>(ws&s).__class__() is WeakSet True >>>s&ws TypeError: unsupported operand type(s) for &: 'set' and 'instance'
the hard olution would add the following behavior: >>>(s&ws).__class__() is WeakSet True Any hint for the easy solution ? for the hard one ? Jean-Philippe -- http://mail.python.org/mailman/listinfo/python-list