Changes by donkopotamus :
--
title: WeakSet should all discard and remove on items that can have weak
references -> WeakSet should allow discard and remove on items that can't have
weak references
___
Python tracker
<http://bugs
donkopotamus added the comment:
Just to add, I framed this slightly wrongly by using a list [] as an example,
whereas my original motivating case was objects that are hashable but not
weakly referenceable. (eg () ).
So there are two cases to consider ... what to do in discard/remove etc
New submission from donkopotamus:
Currently WeakSet().discard([]) will raise a TypeError as we cannot take a weak
reference to a list.
However, that means a list can never be in a WeakSet, so WeakSet().discard([])
could instead be a no-op. Similarly WeakSet().remove([]) could be a KeyError