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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:cd2188cf-c02f-e544-894c-7ce3f765f8a2 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 9928:1367E0:1D15907:287BD87:696FE60E |
| html-safe-nonce | b2233b1be5648b9889f5c859b726f020df68ef3299a550e05571305d1e767698 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTI4OjEzNjdFMDoxRDE1OTA3OjI4N0JEODc6Njk2RkU2MEUiLCJ2aXNpdG9yX2lkIjoiNTU1Nzk5ODE1NzM4ODgzNDMxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d24e70e04498ea5ab469ee17927de60fc6174e272c7ef841190d998d2364ecfb |
| hovercard-subject-tag | pull_request:3129778315 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 |
| 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 full-width-p-0 |
| disable-turbo | false |
| 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