-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Changes from 3 commits
dea574c
7b91698
4126517
40b5006
39a793f
71f04ba
4ae8dd9
5f86a68
ff1a786
0d4ca40
f831920
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added :func:`sys.isinterned`. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,6 +447,23 @@ Return the string itself or the previously interned string object with the\n\ | |
same value."); | ||
|
||
|
||
/*[clinic input] | ||
sys._is_interned -> bool | ||
|
||
string: unicode | ||
/ | ||
|
||
Return True if the given string is "interned". | ||
[clinic start generated code]*/ | ||
|
||
static int | ||
sys__is_interned_impl(PyObject *module, PyObject *string) | ||
/*[clinic end generated code: output=c3678267b4e9d7ed input=039843e17883b606]*/ | ||
{ | ||
return PyUnicode_CHECK_INTERNED(string); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Currently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know. |
||
} | ||
|
||
|
||
/* | ||
* Cached interned string objects used for calling the profile and | ||
* trace functions. Initialized by trace_init(). | ||
|
@@ -1557,6 +1574,7 @@ static PyMethodDef sys_methods[] = { | |
METH_NOARGS, enablelegacywindowsfsencoding_doc }, | ||
#endif /* MS_WINDOWS */ | ||
{"intern", sys_intern, METH_VARARGS, intern_doc}, | ||
SYS__IS_INTERNED_METHODDEF | ||
{"is_finalizing", sys_is_finalizing, METH_NOARGS, is_finalizing_doc}, | ||
#ifdef USE_MALLOPT | ||
{"mdebug", sys_mdebug, METH_VARARGS}, | ||
|
Uh oh!
There was an error while loading. Please reload this page.