8000 gh-128509: Add `sys._is_immortal` for identifying immortal objects by ZeroIntensity · Pull Request #128510 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128509: 8000 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

Merged
merged 20 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove redundant test case.
  • Loading branch information
ZeroIntensity committed Jan 27, 2025
commit 638edd0d3e2e955ca16b3d97d31951ec766e74f2
14 changes: 0 additions & 14 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,20 +713,6 @@ def test_43581(self):
# the test runs under regrtest.
self.assertEqual(sys.__stdout__.encoding, sys.__stderr__.encoding)

@unittest.skipUnless(hasattr(sys, "_is_immortal"), "immortality is not supported")
def test_immortal(self):
# Not extensive
known_immortals = (True, False, None, 0, ())
for immortal in known_immortals:
with self.subTest(immortal=immortal):
self.assertTrue(sys._is_immortal(immortal))

# Some arbitrary mutable objects
non_immortals = (object(), self, [object()])
for non_immortal in non_immortals:
with self.subTest(non_immortal=non_immortal):
self.assertFalse(sys._is_immortal(non_immortal))

def test_intern(self):
has_is_interned = (test.support.check_impl_detail(cpython=True)
or hasattr(sys, '_is_interned'))
Expand Down
0