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:
True
TypeError: unsupported operand type(s) for &: 'set' and 'instance'
the hard olution would add the following behavior:
True
Any hint for the easy solution ?
for the hard one ?
Jean-Philippe
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).__cla ss__() is WeakSet
>>>ws=WeakSet ([b,c])
>>>(ws&s).__cla ss__() is WeakSet
>>>s&ws
the hard olution would add the following behavior:
>>>(s&ws).__cla ss__() is WeakSet
Any hint for the easy solution ?
for the hard one ?
Jean-Philippe
Comment