Title: Compare native signatures and docstrings in whats_left.py by leehanjeong · Pull Request #8751 · RustPython/RustPython · GitHub
Open Graph Title: Compare native signatures and docstrings in whats_left.py by leehanjeong · Pull Request #8751 · RustPython/RustPython
X Title: Compare native signatures and docstrings in whats_left.py by leehanjeong · Pull Request #8751 · RustPython/RustPython
Description: Related #8383 This PR follows our AI policy Summary whats_left.py skipped signatures and docstrings for everything written in Rust, and looked at a module one level deep, so a native class counted as present whatever its methods were. It now compares native functions and methods, including the members of classes a module owns, as discussed on #8725. before after items compared for signature and docstring 3,193 6,647 signature mismatches --signature reports 101 1,151 docstring mismatches --doc reports 93 1,497 modules counted as implemented 184 148 These numbers come from a default-feature Linux build. With --features sqlite, which the weekly data job uses, sqlite3 imports and they shift a little: 1,177 items in --signature, 1,541 docstring mismatches, and three unimportable modules instead of four. What changed A module's docstring mismatches are recorded on their own. They were kept only when the module also had missing items or signature mismatches, so annotationlib, base64, ntpath and _ctypes reported none. A builtin type method that differs is a mismatch, not a missing method. Such a method was listed under "builtin items", the section the website's builtin_items.csv is built from, with both extra_info dicts as the reason. Without this, lifting the skip below turns that section's single line into 455. Native functions and methods are compared. The _signature_is_builtin skip dates from cc2c46b (2021, #2410), when RustPython had no __text_signature__ for builtins. Native classes are opened. 438 classes and 4,062 members, compared as Class.member. A class counts as native when it has no __firstlineno__, which a class statement records, and no Python functions of its own, which rules out namedtuple-style classes made by type(). RustPython follows the CPython list instead of deciding again; a member it only inherits, and that reads differently, is listed with (inherited), and a name implemented as something else, such as _sha3's hash functions, is left to its own line. Ownership comes from the class dictionary. Comparing values, as attr_is_not_inherited() did, dropped 394 of CPython's own class attributes before RustPython was asked about them, 94 of them None-valued like ast.FunctionDef.returns, and took every inherited classmethod, __subclasshook__ for one, for a class's own. An inherited member that reads the same as CPython's own one, like dict_items.__doc__, now counts as present. A module that exists but cannot be imported is reported as such. dir_of_mod_or_error() ran dir() on the exception import_module() returns, so sqlite3 alone filled 198 "missing item" lines and CPython's _ios_support was compared as a module holding ImportError's attributes. Notes The # builtin items section is unchanged and # modules only gains the four "exists but not importable" lines, so both CSVs the weekly job builds are identical. # stdlib items gains 156 class-member lines and loses the 533 that came from those four modules. __builtins__ is no longer compared. inspect.signature() evals defaults in the owning module's namespace and eval() adds __builtins__ there, so CPython's builtins gained one once list.index had been inspected. CPython's __annotations_cache__ and __vectorcalloffset__ are left out as implementation details. The first alone accounts for 112 members on ast nodes. 54 of the new lines are (inherited): members RustPython inherits with a different signature or docstring, __sizeof__ for 13 of them. A full run takes two to three times as long, about 5s to about 12s here, and the generated file grows from 1.2 MB to 2.0 MB. Assisted-by: Claude Code:claude-opus-5 Summary by CodeRabbit Bug Fixes Improved API comparison results by distinguishing missing methods from signature and documentation mismatches. Expanded native and inherited member inspection for more complete compatibility checks. Included built-in callable signatures in comparison results. Improved handling and reporting of module inspection failures. Skipped non-class entries that are not applicable to API comparisons. Modules are now marked complete only when no missing or signature mismatches remain.
Open Graph Description: Related #8383 This PR follows our AI policy Summary whats_left.py skipped signatures and docstrings for everything written in Rust, and looked at a module one level deep, so a native class counte...
X Description: Related #8383 This PR follows our AI policy Summary whats_left.py skipped signatures and docstrings for everything written in Rust, and looked at a module one level deep, so a native class counte...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8751
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:3255b233-0502-f22d-ac18-01279dc49a8d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9F7A:1F927B:1B8E0E4:244D372:6B021B8B |
| html-safe-nonce | 04e5d7a00b6ef2f9e126475c0fae485452cd2d1a693e89c8ae464efcfddb3ee4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjdBOjFGOTI3QjoxQjhFMEU0OjI0NEQzNzI6NkIwMjFCOEIiLCJ2aXNpdG9yX2lkIjoiODI5OTk3MjY5NzI4MzIzODc5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 481a824b5da888470b66611c32a9a8057b318939432a54d3e6e8e39353a091df |
| hovercard-subject-tag | pull_request:4582708474 |
| 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/8751/files |
| twitter:image | https://avatars.githubusercontent.com/u/54920378?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/54920378?s=400&v=4 |
| og:image:alt | Related #8383 This PR follows our AI policy Summary whats_left.py skipped signatures and docstrings for everything written in Rust, and looked at a module one level deep, so a native class counte... |
| 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