[issue24067] Weakproxy is an instance of collections.Iterator

Gareth Rees report at bugs.python.org
Tue Apr 28 12:00:53 CEST 2015


Gareth Rees added the comment:

Not just Iterator, but Container, Hashable, Iterable, and Sized too!

    >>> import weakref
    >>> class C: pass
    >>> o = C()
    >>> w = weakref.proxy(o)
    >>> from collections.abc import *
    >>> isinstance(w, Container)
    True
    >>> isinstance(w, Hashable)
    True
    >>> isinstance(w, Iterable)
    True
    >>> isinstance(w, Sized)
    True

----------
nosy: +Gareth.Rees

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24067>
_______________________________________


More information about the Python-bugs-list mailing list