Title: [C-API] Add a function to access PyCodeObject.co_code in C · Issue #92154 · python/cpython · GitHub
Open Graph Title: [C-API] Add a function to access PyCodeObject.co_code in C · Issue #92154 · python/cpython
X Title: [C-API] Add a function to access PyCodeObject.co_code in C · Issue #92154 · python/cpython
Description: Feature or enhancement Previously, you could access the co_code field in PyCodeObject directly to access the bytecode. This is no longer the case since 2bde682. Currently in 3.11a7+, C code cannot easily obtain the equivalent of co_code ...
Open Graph Description: Feature or enhancement Previously, you could access the co_code field in PyCodeObject directly to access the bytecode. This is no longer the case since 2bde682. Currently in 3.11a7+, C code cannot ...
X Description: Feature or enhancement Previously, you could access the co_code field in PyCodeObject directly to access the bytecode. This is no longer the case since 2bde682. Currently in 3.11a7+, C code cannot ...
Opengraph URL: https://github.com/python/cpython/issues/92154
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C-API] Add a function to access PyCodeObject.co_code in C","articleBody":"**Feature or enhancement**\r\n\r\nPreviously, you could access the `co_code` field in `PyCodeObject` directly to access the bytecode. This is no longer the case since https://github.com/python/cpython/commit/2bde6827ea4f136297b2d882480b981ff26262b6. Currently in 3.11a7+, C code cannot easily obtain the equivalent of `co_code` in 3.10. `co_code_adaptive` gets quickened bytecode which is not equivalent to the 3.10 behavior.\r\n\r\nI would imagine many tools relying on the old behavior will break.\r\n\r\n**Pitch**\r\n\r\nI propose we expose some form of the currently internal `_PyCode_GetCode`.\r\n\r\n**Previous discussion**\r\n\r\nRelated to #91397.\r\nSee also coverage.py issue https://github.com/nedbat/coveragepy/issues/1367\r\n\r\n\r\nCC @vstinner @nedbat @brandtbucher @markshannon ","author":{"url":"https://github.com/Fidget-Spinner","@type":"Person","name":"Fidget-Spinner"},"datePublished":"2022-05-02T15:07:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/92154/cpython/issues/92154"}
| 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:8b5a6899-5318-19c1-433c-5ad02a98f3b3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0FE:10252F:A5E0F7:E2C0F9:696A85BC |
| html-safe-nonce | 47118a435ad03edec78f375791a67a228a59c4574e6568f0f58b1bca612e18a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEZFOjEwMjUyRjpBNUUwRjc6RTJDMEY5OjY5NkE4NUJDIiwidmlzaXRvcl9pZCI6IjM3OTY4MjQxODc0ODA5OTkzNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4b0606a18b1870b28ec8f8317ad6b7c243d3239995c21d67577b611ec186774 |
| hovercard-subject-tag | issue:1223002538 |
| 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/python/cpython/92154/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c08134ff37889ff66249f64d99a529b61f8d30476ac0f728c14d31f7c25da12f/python/cpython/issues/92154 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c08134ff37889ff66249f64d99a529b61f8d30476ac0f728c14d31f7c25da12f/python/cpython/issues/92154 |
| og:image:alt | Feature or enhancement Previously, you could access the co_code field in PyCodeObject directly to access the bytecode. This is no longer the case since 2bde682. Currently in 3.11a7+, C code cannot ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Fidget-Spinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 913560fa317c3c5a71e34f9b19253c9f09d02b4b958a86c2a56f4c8541116377 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 5998c30593994bf2589055aef7b22d368a499367 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width