8000 gh-134819: Add sys.set_object_tags and sys.get_object_tags by corona10 · Pull Request #135073 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134819: Add sys.set_object_tags and sys.get_object_tags #135073

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
Add test
  • Loading branch information
corona10 committed Jun 3, 2025
commit 17ccccfd1f474622b2563bff7e1edd3a362148e3
9 changes: 9 additions & 0 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,15 @@ def __hash__(self):
self.assertRaises(TypeError, sys.intern, S("abc"))
self.assertIs(_is_interned(S("abc")), False)

@support.cpython_only
def test_get_object_tags(self):
keys = ("immortal", "interned", "deferred_refcount")
s = "foobar"
tags = sys.get_object_tags(s)
self.assertEqual(len(tags), len(keys))
for k in keys:
self.assertIn(k, tags)

@support.cpython_only
@requires_subinterpreters
def test_subinterp_intern_dynamically_allocated(self):
Expand Down
Loading
0