Message242159
Calling weakref.proxy() on an object returns something that is an instance of collections.Iterator, regardless of whether the object is an instance of collections.Iterator or even if the object itself is iterable.
To reproduce, run the following code (verified in python2.7 and 3.4 on my Mac):
import collections
import weakref
class NotIterator:
pass
not_iterator = NotIterator()
isinstance(not_iterator, collections.Iterator) # returns False
proxy_object = weakref.proxy(not_iterator)
isinstance(proxy_object, collections.Iterator) # returns True, should be False |
|
Date |
User |
Action |
Args |
2015-04-27 21:42:46 | ereuveni | set | recipients:
+ ereuveni |
2015-04-27 21:42:46 | ereuveni | set | messageid: <1430170966.34.0.831827810985.issue24067@psf.upfronthosting.co.za> |
2015-04-27 21:42:46 | ereuveni | link | issue24067 messages |
2015-04-27 21:42:46 | ereuveni | create | |
|