Skip to content

Conversation

eendebakpt
Copy link
Contributor

@eendebakpt eendebakpt commented May 1, 2025

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
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
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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants