Title: Align Template and Interpolation controls by youknowdot · Pull Request #9709 · RustPython/RustPython · GitHub
Open Graph Title: Align Template and Interpolation controls by youknowdot · Pull Request #9709 · RustPython/RustPython
X Title: Align Template and Interpolation controls by youknowdot · Pull Request #9709 · RustPython/RustPython
Description: Summary Align Template and Interpolation controls with Python 3.15 in two native Rust files (+86/-137). Inherit object identity equality and hashing instead of comparing/hashing payloads structurally. Bind Interpolation's four positional-or-keyword arguments with the existing ArgSpec parser before validating expression, conversion and format_spec in declaration order. Reuse conversion validation for internal and public construction. Dispatch every interpolation repr field through the object protocol, including str-subclass format_spec overrides. Append and release each temporary repr result before invoking the next field; preserve WTF-8 output and exception order. Reuse shared qualified-type formatting for Template construction/concatenation and conversion errors. Preserve Clinic's separate tp_name formatting for expression/format_spec errors. The former format_spec call resolved the inherent PyStr repr and bypassed subclass overrides. This corrects protocol dispatch; it is not presented as a demonstrated panic fix. Validation Compared against CPython d220409a13b77de7a6c30abe16ea90db01528edc interpolationobject.c, templateobject.c and generated Clinic binding. 58 external CPython 3.15 assertions passed, including identity/hash callback non-invocation, named arguments, validation precedence, subtype preservation, repr callbacks/errors/surrogates, temporary-result cleanup and qualified diagnostics. Independent source/lifetime review passed. Corrected type metadata matches CPython's lack of an Interpolation type text signature; new keeps the shared generic wrapper. Threaded cargo check passed (1m29s), all-target Clippy passed (3m27s) with exactly the 12 unchanged baseline diagnostics, and normal commit hooks passed. Native RustPython execution remains unperformed because its required safety guard is not verified. No repository tests, markers, Lib files or workflows are changed; hosted runtime CI remains necessary. Limits and integration Shared ArgSpec unexpected-keyword suggestions and lone-surrogate diagnostic formatting remain outside this change. The shared new wrapper's exact signature formatting is unchanged. Raw constructor inputs remain owned through validation, but call-shape-dependent final argument teardown is controlled by shared FuncArgs/PyType calling machinery. Complete temporary-argument destruction parity is not claimed. Template's distinction between omitted kwargs and explicitly empty **kwargs needs a broader call representation change and is deferred. Constructor::Args changes from the removed public InterpolationArgs to FuncArgs; out-of-tree Rust consumers may need adjustment. In-tree consumers are checked. Qualified names use the existing helper directly inside WTF-8 concatenation, remaining source-compatible with #9700's lossless return type change. No duplicate formatting helper is introduced.
Open Graph Description: Summary Align Template and Interpolation controls with Python 3.15 in two native Rust files (+86/-137). Inherit object identity equality and hashing instead of comparing/hashing payloads structura...
X Description: Summary Align Template and Interpolation controls with Python 3.15 in two native Rust files (+86/-137). Inherit object identity equality and hashing instead of comparing/hashing payloads structura...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9709
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:5b7a05b0-0f53-ff3b-dccf-1e308a04ad6c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E298:2E124E:37E4F64:4769454:6B01FE43 |
| html-safe-nonce | 84fd37a4b9a99c0f0ecec85167971218dbd387ff17ab96cdb6017c3440ab70e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjk4OjJFMTI0RTozN0U0RjY0OjQ3Njk0NTQ6NkIwMUZFNDMiLCJ2aXNpdG9yX2lkIjoiNTI5NTQ5Njk0MTc2Mzk1MjE5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6fa3bde5dffe67dfbf7cef1991608e59ad3c238a57a4db1891a887275691ee79 |
| hovercard-subject-tag | pull_request:5156993753 |
| 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/9709/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 Align Template and Interpolation controls with Python 3.15 in two native Rust files (+86/-137). Inherit object identity equality and hashing instead of comparing/hashing payloads structura... |
| 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