-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-128509: Add sys._is_immortal for identifying immortal objects
#128510
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 1 commit
120bc73
ac45261
b545f24
49b0ea8
b31efe5
45dc9e0
32d7db0
8bb4f62
638edd0
20bb910
64c9a52
7e416e7
10560ef
51daa10
fdcafec
380bca7
74a751a
be49c26
1154cfe
a071b86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
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 |
|---|---|---|
|
|
@@ -955,6 +955,21 @@ sys_intern_impl(PyObject *module, PyObject *s) | |
| } | ||
| } | ||
|
|
||
| /*[clinic input] | ||
| sys._is_immortal -> bool | ||
|
|
||
| op: object | ||
| / | ||
|
|
||
| Return True if the given object is "immortal" per PEP 683. | ||
| [clinic start generated code]*/ | ||
|
|
||
| static int | ||
| sys__is_immortal_impl(PyObject *module, PyObject *op) | ||
| /*[clinic end generated code: output=c2f5d6a80efb8d1a input=83733fc356c78475]*/ | ||
| { | ||
| return _Py_IsImmortal(op); | ||
|
Member
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. Why not using PyUnstable_IsImmortal()?
Member
Author
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. The two are pretty similar. Would you prefer I use the unstable API?
Member
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 would prefer to use the public unstable API, yes. |
||
| } | ||
|
|
||
|
Member
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. unrelated change, I suggest to leave this empty line :-)
Member
Author
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. Good catch! |
||
| /*[clinic input] | ||
| sys._is_interned -> bool | ||
|
|
@@ -2590,6 +2605,7 @@ static PyMethodDef sys_methods[] = { | |
| SYS__GETFRAMEMODULENAME_METHODDEF | ||
| SYS_GETWINDOWSVERSION_METHODDEF | ||
| SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF | ||
| SYS__IS_IMMORTAL_METHODDEF | ||
| SYS_INTERN_METHODDEF | ||
| SYS__IS_INTERNED_METHODDEF | ||
| SYS_IS_FINALIZING_METHODDEF | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.