← 返回首页
GH-101588: Deprecate pickle/copy/deepcopy support in itertools by rhettinger · Pull Request #104965 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

GH-101588: Deprecate pickle/copy/deepcopy support in itertools#104965

Merged
rhettinger merged 7 commits into
python:mainfrom
rhettinger:itertool_pickle_deprecation
May 26, 2023
Merged

GH-101588: Deprecate pickle/copy/deepcopy support in itertools#104965
rhettinger merged 7 commits into
python:mainfrom
rhettinger:itertool_pickle_deprecation

Conversation

rhettinger commented May 26, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

Thomas, the C code deprecation and the related tests were created in a way that should be easy to review and easy to turned-off if need arises.

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

Comment thread Lib/test/test_itertools.py Outdated
import warnings

def pickle_deprecated(testfunc):
""" Run the test twice. On the first pass, verify that a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Is it worth it to run them a third time, with DeprecationWarnings promoted to errors? That usually ends up exercising paths that rarely get considered, but it'd probably be more in pickle than in itertools.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Will do.

rhettinger merged commit 402ee5a into python:main May 26, 2023

Copy link
Copy Markdown
Contributor

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

rhettinger deleted the itertool_pickle_deprecation branch May 26, 2023 20:33
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 26, 2023
…ythonGH-104965) (cherry picked from commit 402ee5a) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

Copy link
Copy Markdown

GH-104997 is a backport of this pull request to the 3.12 branch.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Footer

© 2026 GitHub, Inc.