Skip to content

Implement rest of itertools API #1361

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

Closed
corona10 opened this issue Sep 10, 2019 · 23 comments · Fixed by #1999
Closed

Implement rest of itertools API #1361

corona10 opened this issue Sep 10, 2019 · 23 comments · Fixed by #1999
Assignees
Labels
C-compat A discrepancy between RustPython and CPython

Comments

@corona10
Copy link
Contributor

Feature

There are some APIs does not implement yet.
Let's implement them

Python Documentation

https://docs.python.org/3/library/itertools.html

@corona10 corona10 added the C-compat A discrepancy between RustPython and CPython label Sep 10, 2019
@seeeturtle
Copy link
Contributor

can i try it?

@corona10
Copy link
Contributor Author

@seeeturtle
Sure go ahead.
But please leave a comment which API you will work with so that rest of APIs can be implemented by other Contributhon2019 participants.

@corona10
Copy link
Contributor Author

@coolreader18
Can you assign this issue to @seeeturtle ?
(There may be additional mentees who want to work with)

@seeeturtle
Copy link
Contributor

Sure go ahead.
But please leave a comment which API you will work with so that rest of APIs can be implemented by other Contributhon2019 participants.

sure, i'll try to implement Combinatoric iterators.

@j30ng
Copy link
Contributor

j30ng commented Sep 13, 2019

Hi all, I'll take itertools.accumulate and itertools.tee.

@Thrimbda
Copy link

hello, can I try itertools.groupby?

@coolreader18
Copy link
Member

Yep, go ahead!

@corona10
Copy link
Contributor Author

I am working on itertools.cycle :)

@pitachips
Copy link

I am working on itertools.compress

@dralley
Copy link
Contributor

dralley commented Sep 24, 2019

What is "taken" and who claimed it. I will try to keep this updated including what gets completed. Please leave a reference to this issue in your PRs to make that easier.

Infinite Iterators

  • itertools.count() MERGED
  • itertools.cycle() @dralley MERGED
  • itertools.repeat()MERGED

Iterators terminating on the shortest input sequence

  • itertools.accumulate() @j30ng MERGED
  • itertools.chain() MERGED
  • itertools.chain.from_iterable() @dralley MERGED
  • itertools.compress() @pitachips MERGED
  • itertools.dropwhile() MERGED
  • itertools.filterfalse() MERGED
  • itertools.groupby() MERGED
  • itertools.islice() MERGED
  • itertools.starmap() MERGED
  • itertools.takewhile() MERGED
  • itertools.tee() @j30ng MERGED
  • itertools.zip_longest() @Space0726 MERGED

Combinatoric iterators

  • itertools.product() @seeeturtle MERGED
  • itertools.permutations() @dralley MERGED
  • itertools.combinations() @dralley MERGED
  • itertools.combinations_with_replacement() @dralley MERGED

@Space0726
Copy link
Contributor

Space0726 commented Sep 29, 2019

Hello, Can I try itertools.zip_longest?

@dralley
Copy link
Contributor

dralley commented Oct 1, 2019

No need to ask, just say you're working on it so that others know and don't duplicate work

@yashaslokesh
Copy link

I'll work on itertools.count()

@yashaslokesh
Copy link

I’ll work on itertools.chain.from_iterable() then

seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 13, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 13, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 14, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 14, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 14, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
@seeeturtle
Copy link
Contributor

@dralley , can you remove me from taking combinatoric iterators except product?

seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 15, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 16, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 17, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
seeeturtle added a commit to seeeturtle/RustPython that referenced this issue Oct 20, 2019
This implements `itertools.product` of standard library.

Related with RustPython#1361
@dralley
Copy link
Contributor

dralley commented Nov 17, 2019

@corona10 Are you still working on itertools.cycle()?

@Thrimbda Are you still working on itertools.groupby()?

@Space0726 Are you still working on itertools.zip_longest()?

@Space0726
Copy link
Contributor

Space0726 commented Nov 21, 2019

@Space0726 Are you still working on itertools.zip_longest()?

@dralley Yes, I still working on itertools.zip_longest() and I had finished it once.
It works fine but it was working a bit differently than CPython's itertools.zip_longest(), so I was thinking about it. Should I send a PR first?

dralley added a commit to dralley/RustPython that referenced this issue Nov 21, 2019
dralley added a commit to dralley/RustPython that referenced this issue Nov 21, 2019
dralley added a commit to dralley/RustPython that referenced this issue Nov 21, 2019
dralley added a commit to dralley/RustPython that referenced this issue Nov 21, 2019
dralley added a commit to dralley/RustPython that referenced this issue Nov 22, 2019
dralley added a commit to dralley/RustPython that referenced this issue Nov 22, 2019
@dralley
Copy link
Contributor

dralley commented Nov 22, 2019

@Space0726 Yeah, probably just put a PR up, and maybe the issues can be found during review. If it's got test snippets for the ways in which it isn't working properly, then it won't be merged until it passes the CI anyways.

@dralley
Copy link
Contributor

dralley commented Dec 24, 2019

I'll take cycle and groupby unless someone else wants to (re)claim them. @corona10 @Thrimbda

@corona10
Copy link
Contributor Author

@dralley Please go a head :)

@youknowone youknowone changed the title [Contributhon2019] Implement rest of itertools API Implement rest of itertools API Dec 26, 2019
dralley added a commit to dralley/RustPython that referenced this issue Jan 26, 2020
Implement itertools.groupby

closes RustPython#1361
dralley added a commit to dralley/RustPython that referenced this issue Jan 28, 2020
Implement itertools.groupby

closes RustPython#1361
dralley added a commit to dralley/RustPython that referenced this issue Feb 2, 2020
Implement itertools.groupby

closes RustPython#1361
dralley added a commit to dralley/RustPython that referenced this issue Feb 9, 2020
Implement itertools.groupby

closes RustPython#1361
@dralley
Copy link
Contributor

dralley commented Feb 11, 2020

The last one remaining is itertools.groupby() and it's pretty nasty. I've had it on the backburner for a while and haven't made much progress. If anyone else comes along and wants to tackle it, feel free to do so.

@Space0726
Copy link
Contributor

Space0726 commented Feb 14, 2020

The last one remaining is itertools.groupby() and it's pretty nasty. I've had it on the backburner for a while and haven't made much progress. If anyone else comes along and wants to tackle it, feel free to do so.

@dralley It might be take some time, but I'll try it.

@BenLewis-Seequent
Copy link

I'm currently looking at implementing itertools.groupby for #1983.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

Successfully merging a pull request may close this issue.