Closed Jaymon closed 3 years ago
This means you can't override Iterator.ifilter like this:
Iterator.ifilter
class FooIterator(Iterator): def ifilter(self, o): return True
because ifilter gets set to None when the instance is created, the __init__ method needs to do this:
ifilter
__init__
if ifilter: self.ifilter = ifilter
Or just remove:
self.ifilter = None
And modify the _filtered method to try/catch and AttributeError
_filtered
try/catch
AttributeError
This means you can't override
Iterator.ifilter
like this:because
ifilter
gets set to None when the instance is created, the__init__
method needs to do this:Or just remove:
And modify the
_filtered
method totry/catch
andAttributeError