Skip to content

Implement itertools.tee #1458

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

Merged
merged 5 commits into from
Oct 4, 2019
Merged

Conversation

j30ng
Copy link
Contributor

@j30ng j30ng commented Oct 3, 2019

#1361

Hi, this is my first draft of itertools.tee. I also added some tests for it. Please review, and let me know if there are any bugs to be fixed, or improvements I can make. Thanks.

@j30ng j30ng changed the title Itertools tee Implement itertools.tee Oct 3, 2019
};

let copyable = if objtype::class_has_attr(&iterable.class(), "__copy__") {
vm.call_method(&iterable, "__copy__", PyFuncArgs::from(vec![]))?
Copy link
Member

@youknowone youknowone Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this line is not tested by the new snippets tests. Adding one will be great

j30ng added 2 commits October 4, 2019 15:44
* Test `__copy__` method for `tee` objects works properly.
* Cover the case where the iterable argument passed to `itertools.tee()`
  has `__copy__` method implemented.
@windelbouwman windelbouwman merged commit faee9e3 into RustPython:master Oct 4, 2019
@j30ng j30ng deleted the itertools-tee branch October 4, 2019 16:08
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.

3 participants