Title: Allow c functions in tp_new type slot by bschoenmaeckers · Pull Request #8346 · RustPython/RustPython · GitHub
Open Graph Title: Allow c functions in tp_new type slot by bschoenmaeckers · Pull Request #8346 · RustPython/RustPython
X Title: Allow c functions in tp_new type slot by bschoenmaeckers · Pull Request #8346 · RustPython/RustPython
Description: This is my first draft of allowing C functions in type slots. I started with the NewFunc slot and would love some feedback on my approach before converting the other slots. @youknowone Could you please share your opinion. Summary by CodeRabbit Bug Fixes Improved __new__ constructor dispatch across built-in types (bool, int, float, str, tuple, set) by invoking the resolved constructor target more reliably. Refined the “same/equivalent constructor” detection used for __init fast-path specialization, improving when the optimized path is selected. Improved handling of Rust-backed __new__ wrappers and inherited constructor behavior for classes/types. Compatibility Standardized constructor wiring to support consistent Rust-backed behavior and lay groundwork for additional native __new__ variants.
Open Graph Description: This is my first draft of allowing C functions in type slots. I started with the NewFunc slot and would love some feedback on my approach before converting the other slots. @youknowone Could you pl...
X Description: This is my first draft of allowing C functions in type slots. I started with the NewFunc slot and would love some feedback on my approach before converting the other slots. @youknowone Could you pl...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8346
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:023d599f-41cc-196c-4f91-7685cbb297c4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DE86:3A767B:28E03CF:29EAF1E:6A62FD90 |
| html-safe-nonce | e1ca2051b9a5721797d5f031d3be9a02dc538585e5c3762603b758c197ff43af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTg2OjNBNzY3QjoyOEUwM0NGOjI5RUFGMUU6NkE2MkZEOTAiLCJ2aXNpdG9yX2lkIjoiOTYzMjE2Mzg3MjI1MDkxNDcyIiwicmVnaW9uX2VkZ2UiOiJzZWEiLCJyZWdpb25fcmVuZGVyIjoic2VhIn0= |
| visitor-hmac | 53ceb9d8a5ae3e389c9ff44491835fa163f3328491e5e21243bf9f82a863c60e |
| hovercard-subject-tag | pull_request:4101108619 |
| 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/8346/files |
| twitter:image | https://avatars.githubusercontent.com/u/7943856?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7943856?s=400&v=4 |
| og:image:alt | This is my first draft of allowing C functions in type slots. I started with the NewFunc slot and would love some feedback on my approach before converting the other slots. @youknowone Could you pl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e40dc698184067b40ef2d941585f66ed42711564a879644f984f1eacea129c |
| 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 | b4f544bf80583e749557efd76afda56317b6252d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width