Title: Track remaining test_inspect bytecode parity gaps · Issue #29 · youknowone/RustPython · GitHub
Open Graph Title: Track remaining test_inspect bytecode parity gaps · Issue #29 · youknowone/RustPython
X Title: Track remaining test_inspect bytecode parity gaps · Issue #29 · youknowone/RustPython
Description: Summary This tracks the bytecode parity gaps that still remain after the CFG, slice-folding, constant-ordering, annotation/type-alias, and heavy-function parity fixes. Current status The previous tracked files now match CPython bytecode ...
Open Graph Description: Summary This tracks the bytecode parity gaps that still remain after the CFG, slice-folding, constant-ordering, annotation/type-alias, and heavy-function parity fixes. Current status The previous t...
X Description: Summary This tracks the bytecode parity gaps that still remain after the CFG, slice-folding, constant-ordering, annotation/type-alias, and heavy-function parity fixes. Current status The previous t...
Opengraph URL: https://github.com/youknowone/RustPython/issues/29
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Track remaining test_inspect bytecode parity gaps","articleBody":"Summary\n\nThis tracks the bytecode parity gaps that still remain after the CFG, slice-folding, constant-ordering, annotation/type-alias, and heavy-function parity fixes.\n\nCurrent status\n\nThe previous tracked files now match CPython bytecode with the release RustPython binary:\n\n- `Lib/test/test_buffer.py`: match\n- `Lib/test/test_tarfile.py`: match\n- `Lib/test/test_codecs.py`: match\n- `Lib/doctest.py`: match\n\nThe only remaining tracked file that still differs is:\n\n- `Lib/test/test_inspect/test_inspect.py`\n\nCurrent `scripts/compare_bytecode.py --filter 'test/test_inspect/test_inspect.py' --detail` result\n\n```text\ntest/test_inspect/test_inspect.py:\n \u003cmodule\u003e/TestRetrievingSourceCode/TestRetrievingSourceCode.test_getsource_on_class_without_firstlineno/TestRetrievingSourceCode.test_getsource_on_class_without_firstlineno.\u003clocals\u003e.C: 1 difference(s)\n [ 7] CPython: ['STORE_DEREF', '__firstlineno__']\n RustPython: ['STORE_NAME', '__firstlineno__']\n\n \u003cmodule\u003e/TestGetClosureVars/TestGetClosureVars.test_nonlocal_vars/TestGetClosureVars.test_nonlocal_vars.\u003clocals\u003e.\u003clambda\u003e/TestGetClosureVars.test_nonlocal_vars.\u003clocals\u003e.\u003clambda\u003e.\u003clocals\u003e.\u003clambda\u003e: 1 difference(s)\n extra in CPython\n\n \u003cmodule\u003e/TestGetClosureVars/TestGetClosureVars.test_nonlocal_vars/TestGetClosureVars.test_nonlocal_vars.\u003clocals\u003e.\u003clambda\u003e/TestGetClosureVars.test_nonlocal_vars.\u003clocals\u003e.\u003clambda\u003e.\u003clambda\u003e: 1 difference(s)\n extra in RustPython\n```\n\nRemaining root causes\n\n- Class-body `__firstlineno__` store does not follow CPython name resolution in the nonlocal case.\n - CPython 3.14 `Python/codegen.c` emits `__firstlineno__` through `codegen_nameop(..., Store)` in `codegen_class_body`.\n - RustPython currently emits `STORE_NAME __firstlineno__` directly in `compile_class_body`, so a class body with `nonlocal __firstlineno__` does not become `STORE_DEREF`.\n- Nested lambda code-object naming/order still differs in `TestGetClosureVars.test_nonlocal_vars`.\n - One nested lambda code object appears as extra in CPython and the corresponding one appears extra in RustPython.\n\nPolicy\n\nDo not paper over these diffs with file-specific hacks in `Lib/`. Fix them through shared compiler structure, preferably by following CPython 3.14 compiler behavior.\n\nDone when\n\n`Lib/test/test_inspect/test_inspect.py` reports `match` in `scripts/compare_bytecode.py` with the release RustPython binary, and the two representative diffs above are gone.\n","author":{"url":"https://github.com/youknowone","@type":"Person","name":"youknowone"},"datePublished":"2026-04-20T15:28:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/29/RustPython/issues/29"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c9203451-b67e-55d0-5e4f-73e124416e81 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81FA:1C0DF3:2705B50:332922C:6A5CBE1B |
| html-safe-nonce | 24e5454b4a89c6b71f68a9652fbe0d8a6450f6a0f730fea66d24b563cd43d382 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUZBOjFDMERGMzoyNzA1QjUwOjMzMjkyMkM6NkE1Q0JFMUIiLCJ2aXNpdG9yX2lkIjoiNzUxNDA2ODkzNDIyNjM5NDY1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0098d5c06db8c3ce79a4905d87415b820e67823234a6a41c38977d2108fe1491 |
| hovercard-subject-tag | issue:4296807741 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/youknowone/RustPython/29/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09d9c673c7b3c263ab0ba69268f1222efafea533079adfdeffe777a05382a6b9/youknowone/RustPython/issues/29 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09d9c673c7b3c263ab0ba69268f1222efafea533079adfdeffe777a05382a6b9/youknowone/RustPython/issues/29 |
| og:image:alt | Summary This tracks the bytecode parity gaps that still remain after the CFG, slice-folding, constant-ordering, annotation/type-alias, and heavy-function parity fixes. Current status The previous t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | youknowone |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/youknowone/RustPython git https://github.com/youknowone/RustPython.git |
| octolytics-dimension-user_id | 69878 |
| octolytics-dimension-user_login | youknowone |
| octolytics-dimension-repository_id | 182779261 |
| octolytics-dimension-repository_nwo | youknowone/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 135201145 |
| octolytics-dimension-repository_parent_nwo | RustPython/RustPython |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width