Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Mar 30, 2022

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

@brandtbucher brandtbucher added type-bug An unexpected behavior, bug, or error skip news labels Mar 30, 2022
@markshannon markshannon merged commit ae9de82 into python:main Apr 1, 2022
@brandtbucher brandtbucher deleted the co-code-adaptive-bytes branch July 21, 2022 19:52
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