Content-Length: 278577 | pFad | https://github.com/python/cpython/issues/92154

CF [C-API] Add a function to access PyCodeObject.co_code in C · Issue #92154 · python/cpython · GitHub
Skip to content

[C-API] Add a function to access PyCodeObject.co_code in C #92154

@Fidget-Spinner

Description

@Fidget-Spinner

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 in 3.10. co_code_adaptive gets quickened bytecode which is not equivalent to the 3.10 behavior.

I would imagine many tools relying on the old behavior will break.

Pitch

I propose we expose some form of the currently internal _PyCode_GetCode.

Previous discussion

Related to #91397.
See also coverage.py issue coveragepy/coveragepy#1367

CC @vstinner @nedbat @brandtbucher @markshannon

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/92154

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy