Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-118761: improve import time for pickle #128732

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

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 3 Lib/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import sys
from sys import maxsize
from struct import pack, unpack
import re
import io
import codecs
import _compat_pickle
Expand Down Expand Up @@ -188,7 +187,7 @@ def __init__(self, value):
NEXT_BUFFER = b'\x97' # push next out-of-band buffer
READONLY_BUFFER = b'\x98' # make top of stack readonly

__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$", x)])
__all__.extend(x for x in dir() if x.isupper() and not x.startswith('_'))
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved


class _Framer:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Improve import time of :mod:`pickle` by 25% by removing an unnecessary
regular expression. As such, :mod:`re` is no more implicitly available
as ``pickle.re``. Patch by Bénédikt Tran.
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.