Title: Align object.__sizeof__ with CPython for ints by Copilot · Pull Request #6516 · RustPython/RustPython · GitHub
Open Graph Title: Align object.__sizeof__ with CPython for ints by Copilot · Pull Request #6516 · RustPython/RustPython
X Title: Align object.__sizeof__ with CPython for ints by Copilot · Pull Request #6516 · RustPython/RustPython
Description: The base object.__sizeof__ returned only the type basic size, underreporting memory for variable-sized ints compared to CPython.
Int-aware sizing: object.__sizeof__ now calculates int sizes using the same bit-length-based formula as int.__sizeof__, ensuring parity for arbitrary-sized integers.
Regression guard: Added a snippet test to assert object.__sizeof__ is never smaller than int.__sizeof__ for a very large integer.
Example:
big = 10**200
assert object.__sizeof__(big) >= big.__sizeof__() # matches CPython-style sizing
Original prompt
This section details on the original issue you should resolve
Open Graph Description: The base object.__sizeof__ returned only the type basic size, underreporting memory for variable-sized ints compared to CPython. Int-aware sizing: object.__sizeof__ now calculates int sizes using ...
X Description: The base object.__sizeof__ returned only the type basic size, underreporting memory for variable-sized ints compared to CPython. Int-aware sizing: object.__sizeof__ now calculates int sizes using ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/6516
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:754c4c2b-ff1e-8695-d34c-ed67c36e15e6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B388:3D089B:1CD26D8:28312F9:696FE56B |
| html-safe-nonce | 20c6e6b3413c1837325cdc6ca065d16f080d509545f4e340c0cb7f00af8db239 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzg4OjNEMDg5QjoxQ0QyNkQ4OjI4MzEyRjk6Njk2RkU1NkIiLCJ2aXNpdG9yX2lkIjoiMTQ4MzQ3OTE0NDc0NzQzMTQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 28f653a50c0ab32778a03d1391661ddf9c59e8e47e2b9dd0551f962d0fdba085 |
| hovercard-subject-tag | pull_request:3129778315 |
| 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/6516/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | The base object.__sizeof__ returned only the type basic size, underreporting memory for variable-sized ints compared to CPython. Int-aware sizing: object.__sizeof__ now calculates int sizes using ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | bb7c872aa74896d911608183f4997f8b9c121a1624064705ec4570cd91bd7839 |
| 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 | 257e1b418957178bd3ac9f7520608a40ebbb0f1e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width