Title: Return None from bisect insort by youknowdot · Pull Request #9630 · RustPython/RustPython · GitHub
Open Graph Title: Return None from bisect insort by youknowdot · Pull Request #9630 · RustPython/RustPython
X Title: Return None from bisect insort by youknowdot · Pull Request #9630 · RustPython/RustPython
Description: Consolidated into #9629 Closed after verifying #9629 at 1eae2eb5b1534c20bfd79f9befc0075661096136 includes this branch's latest head 28395170fc393de1ecb337ffe3abf23d4cf4c9df as an ancestor. Both insort result-disposal and argument-lifetime behavior are preserved. The final redundant-clone lint expectations are superseded by borrowed arguments. The combined change passed native bisect tests, CPython 3.15 differential probes, full workspace and separate C-API Rust tests, and both strict Clippy runs. Summary Discard the result of a custom sequence's insert() in both _bisect.insort directions and return None, as CPython does. Keep the input and key objects alive through destruction of that result, so its finalizer cannot observe them being released prematurely. Search and insertion exceptions still propagate. Scope and integration Existing differences in lo/hi argument lifetime and callback order, as well as the lack of an exact-list native insertion fast path, remain separate. The bounds-order follow-on on #9629 now conflicts textually with this branch's insort hunks. A manually composed version retaining this PR's result-discard and ownership behavior has been independently source-reviewed; no merge has been performed. Validation Compared with CPython 3.15.0 _bisectmodule.c. CPython 3.15 reproductions confirmed both directions return None for an insert() returning a sentinel and release an ephemeral insertion result before the input and key objects. Independent source review of this change and of the manual #9629 composition, plus normal commit hooks (including rustfmt), passed. RustPython was not built or executed locally. No tests were added or changed; hosted CI is expected to run existing bisect tests.
Open Graph Description: Consolidated into #9629 Closed after verifying #9629 at 1eae2eb5b1534c20bfd79f9befc0075661096136 includes this branch's latest head 28395170fc393de1ecb337ffe3abf23d4cf4c9df as an ancestor. Both...
X Description: Consolidated into #9629 Closed after verifying #9629 at 1eae2eb5b1534c20bfd79f9befc0075661096136 includes this branch's latest head 28395170fc393de1ecb337ffe3abf23d4cf4c9df as an ancestor. ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9630
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:73120f3a-089b-b351-e1f1-b838b95e9329 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DBF8:2270F4:3622055:47C8843:6B02028C |
| html-safe-nonce | cfd626cd107266ebe680e2cd7aca345b952460604cf8281e2aa60a678daec637 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkY4OjIyNzBGNDozNjIyMDU1OjQ3Qzg4NDM6NkIwMjAyOEMiLCJ2aXNpdG9yX2lkIjoiNjAyNjM1MjgxNzY0NjczMTkxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ac0ac1c2f339184c93f3062c5c8de79fda69b52c67aabb6e77f03059b0ac647 |
| hovercard-subject-tag | pull_request:5138891563 |
| 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/9630/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 | Consolidated into #9629 Closed after verifying #9629 at 1eae2eb5b1534c20bfd79f9befc0075661096136 includes this branch's latest head 28395170fc393de1ecb337ffe3abf23d4cf4c9df as an ancestor. Both... |
| 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 |
| 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