[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-18 Thread donkopotamus
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

[issue30100] WeakSet should all discard and remove on items that can have weak references

2017-04-19 Thread donkopotamus
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

[issue30100] WeakSet should allow discard and remove on items that can't have weak references

2017-04-23 Thread donkopotamus
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