◐ Shell
clean mode source ↗

bpo-34392: Add sys. _is_interned() by serhiy-storchaka · Pull Request #8755 · python/cpython

pablogsal

sys_isinterned_impl(PyObject *module, PyObject *string)
/*[clinic end generated code: output=0364c3f36499f868 input=2fe09bef8edf732e]*/
{
return PyUnicode_CHECK_INTERNED(string);

Choose a reason for hiding this comment

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

Question: Currently sys.internmakes 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?

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

@csabella

@methane, should this be merged after fixing the merge conflicts? Thanks!

@methane methane changed the title bpo-34392: Add sys.isinterned(). bpo-34392: Add sys. _is_interned()

May 26, 2020

@methane

@methane, should this be merged after fixing the merge conflicts? Thanks!

Up to @serhiy-storchaka. He wanted this API to write some tests.

methane

…92.9kIlMF.rst

Co-authored-by: Inada Naoki <songofacandy@gmail.com>

iritkatriel

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.

@bedevere-bot

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@serhiy-storchaka

I have made the requested changes; please review again.

aisk pushed a commit to aisk/cpython that referenced this pull request

Feb 11, 2024

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request

Sep 2, 2024