Title: test_track_literals depends on a garbage collection · Issue #155728 · python/cpython · GitHub
Open Graph Title: test_track_literals depends on a garbage collection · Issue #155728 · python/cpython
X Title: test_track_literals depends on a garbage collection · Issue #155728 · python/cpython
Description: Bug report _not_tracked_instantly() requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracked by _PyTuple_MaybeUntrack(), which is c...
Open Graph Description: Bug report _not_tracked_instantly() requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracke...
X Description: Bug report _not_tracked_instantly() requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracke...
Opengraph URL: https://github.com/python/cpython/issues/155728
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_track_literals depends on a garbage collection","articleBody":"# Bug report\n\n`_not_tracked_instantly()` requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracked by `_PyTuple_MaybeUntrack()`, which is called only from the collector.\n\n```\n$ ./python -c \"import gc; print(gc.is_tracked((1,)))\"\nTrue\n```\n\nSo `test_track_literals` passes only if a collection happens between importing the module and running the test. Under regrtest it does not:\n\n```\n$ ./python -m test test_tuple -m test_track_literals\nAssertionError: True is not false : (1,)\n```\n\nwhile `./python -m unittest test.test_tuple.TupleTest.test_track_literals` passes.\n\nUntracking tuple constants when the code object is created would let the test keep the stronger check.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156419\n* gh-156423\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-08-13T15:31:19Z","url":"https://github.com/python/cpython/issues/155728"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:98cbfcb0-e10e-914d-dba4-79b062c33198 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD2E:3A73AA:3660E53:44E3DF9:6B022049 |
| html-safe-nonce | 6e50afad8dfac1b3090e17db875fbd425c4bf70f4f2d5ddf29a438b6d88731d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDJFOjNBNzNBQTozNjYwRTUzOjQ0RTNERjk6NkIwMjIwNDkiLCJ2aXNpdG9yX2lkIjoiMjQ0MzQ1OTgyMzM3MTY5MDA1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5e8e09b6d69c32659e957ce35312f8cbfc6fd4683dc7ee75fbeb5cd4040cb297 |
| hovercard-subject-tag | issue:5143038987 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/155728/issue_layout |
| twitter:image | https://opengraph.githubassets.com/900861d3c03b35b752b072f676cea99fe6038aac87cab80867e775110d7a6b2c/python/cpython/issues/155728 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/900861d3c03b35b752b072f676cea99fe6038aac87cab80867e775110d7a6b2c/python/cpython/issues/155728 |
| og:image:alt | Bug report _not_tracked_instantly() requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracke... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width