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

Write CONTRIBUTING.md #756

Closed
jswrenn opened this issue Sep 19, 2023 · 3 comments · Fixed by #767
Closed

Write CONTRIBUTING.md #756

jswrenn opened this issue Sep 19, 2023 · 3 comments · Fixed by #767

Comments

@jswrenn
Copy link
Member

jswrenn commented Sep 19, 2023

Itertools needs a CONTRIBUTING.md. Key highlights should include:

A complete guide should also address:

  • When to implement DoubleEndedIterator
  • When to implement ExactSizeIterator
  • When to implement FusedIterator.

(Anything else?)

Happy to provide mentorship on this.

@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Sep 20, 2023

I recently contributed about each of those points (except DoubleEndedIterator) and there are key points I would have liked to know early on so I think I can help here. I'm starting a draft: Philippe-Cholet/itertools@master...contributing
Mentorship welcomed.

EDIT: Markdown rendered here. I try to be as complete and precise but brief as possible.

@Philippe-Cholet
Copy link
Member

  • I would like some feedback on my draft of "CONTRIBUTING.md".
  • However, even if I am familiar with all kind of tests we do here, I did not write anything about testing yet as it's still unclear to me what should be suggested exactly. I think some clarification would be useful.
  • After seeing "specialization tests" a few days ago, I had ideas to extend this further. I'd like to know if such thing would be of interest (we would discuss this further in another issue):

tests/specializations.rs definitely seems promising (I really like the Unspecialized struct) but all apply some "closure" only on a fresh iterator and not on an iterator that has yielded elements. A buggy iterator could behave differently if those were applied later on.
I've experimented quite a bit (and eventually ditched macros, for sanity) to check size_hint/count/last/nth/fold/collect (as most of our specialized methods are those) at every step of iteration (at the start and after every next). And it works fine but is slower as you might expect, so I added the possibility to limit this to a few steps.
Usage (example) would remain nice but my implementation is definitely way more verbose (working branch: master...Philippe-Cholet:itertools:test-specializations).

@jswrenn
Copy link
Member Author

jswrenn commented Sep 28, 2023

Can you file a draft PR for CONTRIBUTING.md?

I'm very interested in seeing our specialization tests improved further!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants