Title: __str__ with slot wrapper, generate slot with #[pymethod] by youknowone · Pull Request #6485 · RustPython/RustPython · GitHub
Open Graph Title: __str__ with slot wrapper, generate slot with #[pymethod] by youknowone · Pull Request #6485 · RustPython/RustPython
X Title: __str__ with slot wrapper, generate slot with #[pymethod] by youknowone · Pull Request #6485 · RustPython/RustPython
Description: Not sure this is a good idea or not. Motivation: we have too many fragmented traits, which are easy to forget to add in with() attrs. Now __str__ will more looking like a normal #[pymethod]. But what it backs will be very different. It actually doesn't create a real pymethod, but actually creating slot_str. And __str__ will be placed by a slot-wrapper descriptor. After the patch, #[pymethod] fn __str__ will additionally create a pyslot for str. This can be applicable to other single-method traits too. Pros: Easy to understand. No worry to forget to add with() Cons: Confusing because it have different semantics comparing to other real pymethods.
Open Graph Description: Not sure this is a good idea or not. Motivation: we have too many fragmented traits, which are easy to forget to add in with() attrs. Now __str__ will more looking like a normal #[pymethod]. But wh...
X Description: Not sure this is a good idea or not. Motivation: we have too many fragmented traits, which are easy to forget to add in with() attrs. Now __str__ will more looking like a normal #[pymethod]. But wh...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6485
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:304477e8-5feb-d815-ed94-5e757b405983 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BB84:3217AD:F877DA:15D418B:69722F4B |
| html-safe-nonce | c23dba274a209a1d732c82e4c735a94d87565a51a90e35931523c498e426831d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjg0OjMyMTdBRDpGODc3REE6MTVENDE4Qjo2OTcyMkY0QiIsInZpc2l0b3JfaWQiOiIyMTk5Nzg3NjY3MDEwNDk4Mzc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f160d79d1c6670e0d3dea561fc5b7612c19c5a0328a268884a575535417a96f1 |
| hovercard-subject-tag | pull_request:3128453217 |
| 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/6485/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | Not sure this is a good idea or not. Motivation: we have too many fragmented traits, which are easy to forget to add in with() attrs. Now __str__ will more looking like a normal #[pymethod]. But wh... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2c16db4e575031f6e3be03e0437c1ab663e0b4643ba5cbbfba48c1e4fc056a11 |
| 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 | a12ab519e1537fa080535ea933f81d4fcef34da0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width