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

Add an implementation of unzip #241

Merged
merged 6 commits into from Jun 26, 2015
Merged

Conversation

davidshepherd7
Copy link
Contributor

Here's the unzip implementation I described in #239 cleaned up and with documentation.

I'm still concerned about tee's memory usage as it could result in difficult-to-debug high memory usage. However I don't currently have any other ideas that would allow lazyness.

@eriknw
Copy link
Member

eriknw commented May 16, 2015

I think it will be more convenient if unzip returns a tuple, not an iterator. I also think this will encourage more idiomatic use, since all iterators should be consumed at a similar rate to limit the impact of tee.

I'm less concerned about having ultimate flexibility with being able to handle an infinite number of iterables with infinite length. How would one operate on that effectively? I don't know (but maybe answering that will reveal how to limit the impact of tee). Anyway, there is a balance to be had between flexibility and convenience.

I'd like to merge this. Do you agree about returning a tuple?

@davidshepherd7
Copy link
Contributor Author

I changed it to return a tuple, and also fixed a bug I came across with empty iterators. Tests pass on my machine (python2 and 3) so it should be ok to merge.

@davidshepherd7
Copy link
Contributor Author

Any more thoughts on merging this?

@eriknw
Copy link
Member

eriknw commented Jun 26, 2015

Any more thoughts on merging this?

Yeah, my bad. I think I stretch myself too thinly at times.

This is good to go. Thanks, @davidshepherd7!

eriknw added a commit that referenced this pull request Jun 26, 2015
Add an implementation of unzip
@eriknw eriknw merged commit 8cdc7fe into pytoolz:master Jun 26, 2015
@davidshepherd7
Copy link
Contributor Author

Yeah, my bad. I think I stretch myself too thinly at times.

I completely understand. 👍

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.

None yet

2 participants