-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-34392: Add sys. _is_interned() #8755
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
bpo-34392: Add sys. _is_interned() #8755
Conversation
sys_isinterned_impl(PyObject *module, PyObject *string) | ||
/*[clinic end generated code: output=0364c3f36499f868 input=2fe09bef8edf732e]*/ | ||
{ | ||
return PyUnicode_CHECK_INTERNED(string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Currently sys.intern
makes a PyUnicode_CheckExact(s)
over the string so interning a subclass of a string gives a TypeError
back. This returns False
. Does it make sense to do a exact check to mirror the interface of sys.intern
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know.
@methane, should this be merged after fixing the merge conflicts? Thanks! |
Up to @serhiy-storchaka. He wanted this API to write some tests. |
Misc/NEWS.d/next/Core and Builtins/2018-08-13-13-25-15.bpo-34392.9kIlMF.rst
Outdated
Show resolved
Hide resolved
…92.9kIlMF.rst Co-authored-by: Inada Naoki <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has merge conflicts now.
When you're done making the requested changes, leave the comment: |
I have made the requested changes; please review again. |
Merge conflicts are resolved.
https://bugs.python.org/issue34392
#78573