New submission from Nils Kattenbeck <nilskem...@gmail.com>:
Instances of weakref.WeakSet are not instances of Set and therefore not of MutableSet but they are instances of Collection. They however implement all required methods for a MutableSet and Weak(Key|Value)Dictionary are correctly identified. Is this just an oversight or am I missing something? from weakref import WeakKeyDictionary, WeakValueDictionary, WeakSet from collections.abc import MutableMapping, Collection, Set, MutableSet wkdict = WeakKeyDictionary() wvdict = WeakValueDictionary() ws = WeakSet() assert isinstance(wkdict, MutableMapping) assert isinstance(wvdict, MutableMapping) assert isinstance(ws, Collection) assert not isinstance(ws, Set) assert not isinstance(ws, MutableSet) ---------- components: Library (Lib) messages: 356326 nosy: Nils Kattenbeck priority: normal severity: normal status: open title: weakref.WeakSet not instanceof collections.abc.Set versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38761> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com