◐ Shell
reader mode source ↗
Skip to content

bpo-46841: Use a bytes object for _co_code_adaptive#32205

Merged
markshannon merged 2 commits into
python:mainfrom
brandtbucher:co-code-adaptive-bytes
Apr 1, 2022
Merged

bpo-46841: Use a bytes object for _co_code_adaptive#32205
markshannon merged 2 commits into
python:mainfrom
brandtbucher:co-code-adaptive-bytes

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Mar 30, 2022

Copy link
Copy Markdown
Member

The memoryview was a fun idea, but it actually creates some subtle memory management issues (since it can possibly outlive the code object it references).

While we could fix this by hacking around inside of the returned memoryview or giving code objects full buffer protocol support, a bytes object is totally fine here (and it even makes disassembly a bit easier).

https://bugs.python.org/issue46841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants