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

iterable Composition object #559

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZeroBomb
Copy link

I previously suggested that compositions should be iterable in issue #553

I decided to see what that would look like, and have included the code here. The change is pretty trivial (adding an __iter__ function to the Compose object) and I went ahead and simplified the __doc__, __name__, and __repr__ functions to take advantage of the fact that you can just use self as an iterable to remove reversed((first,)+funcs).

I don't know how your tests work, but it seems to work fine with all my code. The only way I can imagine this breaking anything is if the code ever checks for iterability to decide if something is a Compose object, but I didn't see anything like that.

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

Successfully merging this pull request may close these issues.

1 participant