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

Document that itertools classes are picklable #103614

Closed
Gouvernathor opened this issue Apr 18, 2023 · 3 comments
Closed

Document that itertools classes are picklable #103614

Gouvernathor opened this issue Apr 18, 2023 · 3 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@Gouvernathor
Copy link
Contributor

Gouvernathor commented Apr 18, 2023

Feature or enhancement

Document as a feature that the callables provided in the itertools module work with the pickle module.

Pitch

Pickling is very useful in general. By trying, I found that itertools.cycle objects were picklable.
Most iterators do not support pickling, this is notably the case with the basic generators shown as examples in the itertools doc page.
So, documenting that as a feature would be good so that apps can rely on it and not fear breakage when upgrading versions of python.
Of course, if maintainers are frosty about guaranteeing that for specific callables, documenting it for some and not others is good enough too.

(I didn't file this as a documentation issue because it's not a problem with the documentation.)

@Gouvernathor Gouvernathor added the type-feature A feature request or enhancement label Apr 18, 2023
@terryjreedy terryjreedy added the docs Documentation in the Doc dir label Apr 18, 2023
@pochmann
Copy link
Contributor

pochmann commented Apr 18, 2023

See #101588 though ("Deprecate pickle support for itertools").

@terryjreedy
Copy link
Member

A doc issue is an issue whose patch would only affect the docs in the repository /Docs directory. Changes can be either fixes or new features.

As I remember, the implementation of the itertools functions as C classes is a CPython implementation detail for speed. Another implementation could implement the module in Python using the generator functions in the docs. This is why the functions have lower-case function names rather than upper-case class names.

We changed the description of the generator functions from 'equivalent' to 'roughly equivalent' because some people took 'equivalent' to mean exactly equivalent in all visible behaviors.

Besides all this, Raymond now wants to get rid of itertools pickling.

@Gouvernathor
Copy link
Contributor Author

Gouvernathor commented Apr 18, 2023

@terryjreedy in that case, the Documentation entry would gain from being rephrased as "Report a problem or request a change in the documentation". The current formulation, "Report a problem with the documentation", is what made me choose the "feature" category instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants