-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Add sys.isinterned() #78573
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
Comments
I need to test whether the string is interned for Python implementations of marshal.dumps(). It is easy to do in C, and I suggest to expose this functionality to Python. Currently you can test if the string is interned using the following function: def isinterned(s):
return sys.intern(s) is s But it has a side effect -- it interns a string if it is not equal to an already interned string. |
I'd prefer to have this as an internal API, either sys._isinterned() or as a helper method in testcapi. |
I agree with Christian; this is an implementation detail so it should be flagged as private/internal somehow. |
Agreed it should be non-public, but can we please call it sys._is_interned()? |
Thank you all for the feedback. The function is renamed to sys._is_interned() and documented as optional. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: