Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterator.ifilter gets set to None in __init__ #113

Closed
Jaymon opened this issue Jun 30, 2020 · 0 comments
Closed

Iterator.ifilter gets set to None in __init__ #113

Jaymon opened this issue Jun 30, 2020 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Jun 30, 2020

This means you can't override Iterator.ifilter like this:

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:

if ifilter:
    self.ifilter = ifilter

Or just remove:

self.ifilter = None

And modify the _filtered method to try/catch and AttributeError

@Jaymon Jaymon closed this as completed in ecd41a3 Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant