Title: Expose sys._is_interned and order interned-state publication by youknowdot · Pull Request #9430 · RustPython/RustPython · GitHub
Open Graph Title: Expose sys._is_interned and order interned-state publication by youknowdot · Pull Request #9430 · RustPython/RustPython
X Title: Expose sys._is_interned and order interned-state publication by youknowdot · Pull Request #9430 · RustPython/RustPython
Description: Summary Expose sys._is_interned() using the object's existing interned flag. The query does not intern its argument or mistake equal content (or immortality) for interning. It accepts string subclasses without coercion and takes one positional-only argument. Mark a newly inserted string as interned before releasing the string-pool write lock. Previously, another lookup could return the published entry before its interned flag was set. Only the successful insertion is marked; an equal-but-distinct losing input remains uninterned. The predicate follows CPython’s direct intern-state query; the pool-ordering change closes a RustPython-specific publication window. This supplies a real prerequisite for the canonical Python 3.15 free-threading string tests, rather than adding a test-only helper or skip. Those tests are not included here: their package is tracked separately in #9428. No Lib modifications or xfail changes. Validation Independently reviewed flag semantics, publication ordering, positional argument binding, and existing interner ownership/refcount behavior. Focused cargo check and strict cargo clippy -- -D warnings passed with --no-default-features --features threading,stdlib,stdio,importlib,host_env,doc,ucd_3_2_0; bounded executable build passed. Existing canonical test.test_sys.SysModuleTest.test_intern: 1 passed. 18 bounded functional checks matched CPython 3.15 for identity, non-mutating queries, equal-but-distinct strings, subclasses, wrong types/arity, keywords, and Unicode/surrogates. Applicable hooks and git diff --check passed. Generic argument-error wording still differs from CPython for missing/extra positional arguments and bytes/None inputs; the error types and rejection behavior match. No concurrent stress test or full workspace test run was performed, so these results do not prove general free-threading compatibility. Build/runtime provenance and the immutable-source comparison were checked against a protected executable copy; runtime checks used disposable HOME/cwd and bounded time/memory. The existing test module's helper performs a finite loopback IPv6 capability probe; no external network connection was made. Summary by CodeRabbit New Features Added sys._is_interned(string) to check whether a string is interned. Bug Fixes Improved consistency when strings are added to the intern pool.
Open Graph Description: Summary Expose sys._is_interned() using the object's existing interned flag. The query does not intern its argument or mistake equal content (or immortality) for interning. It accepts string s...
X Description: Summary Expose sys._is_interned() using the object's existing interned flag. The query does not intern its argument or mistake equal content (or immortality) for interning. It accepts stri...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9430
X: @github
Domain: github.com
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:37dfd611-73ae-b072-7c2f-1c3e7643a6f4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C0D0:1F927B:167FB82:1DB4136:6B01FE7C |
| html-safe-nonce | a7703b5eab9f12dfa72ef0a1cfcb73b54213feda12e5766e650e6295269d1e06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEQwOjFGOTI3QjoxNjdGQjgyOjFEQjQxMzY6NkIwMUZFN0MiLCJ2aXNpdG9yX2lkIjoiMjIxNTYyNTgzNTY4MjA3MDE0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 216f269bcebfbae70342d3ffd15ebb3eed8ad3780e455d9285e90511d0ac153c |
| hovercard-subject-tag | pull_request:5050808975 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/RustPython/RustPython/pull/9430/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Expose sys._is_interned() using the object's existing interned flag. The query does not intern its argument or mistake equal content (or immortality) for interning. It accepts string s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| 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 |
Links:
Viewport: width=device-width