Skip to content

gh-124397: Add itertools.serialize (name tbd) - #133272

Closed
eendebakpt wants to merge 2 commits into
python:mainfrom
eendebakpt:itertools_serialize
Closed

eendebakpt wants to merge 2 commits into
python:mainfrom
eendebakpt:itertools_serialize

Conversation

@eendebakpt

@eendebakpt eendebakpt commented May 1, 2025 •

Copy link
Copy Markdown
Contributor

Add itertools.serialize to make a non-threadsafe iterator thread-safe.

  • Bikeshedding on the naming (thread at discuss.python.org)
  • Update documentation
  • Add method to make generator function thread-safe (probably a followup PR)

📚 Documentation preview 📚: https://cpython-previews--133272.org.readthedocs.build/

@rhettinger

Copy link
Copy Markdown
Contributor

Do you think this belongs in itertools or in threading? I could see a case for either one.

@rhettinger
rhettinger removed their request for review May 1, 2025 21:18
@eendebakpt

Copy link
Copy Markdown
Contributor Author

Do you think this belongs in itertools or in threading? I could see a case for either one.

I see your point. Serhey also mentioned threading as a better option on discourse. I think I would prefer moving to the threading module, but also add link to the new method in the itertools documentation.

@eendebakpt

Copy link
Copy Markdown
Contributor Author

Closing in favor of #133908

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

2 participants