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-38140: Make dict and weakref offsets opaque for C heap types #16076

Merged
merged 2 commits into from
Sep 19, 2019

Conversation

eduardo-elizondo
Copy link
Contributor

@eduardo-elizondo eduardo-elizondo commented Sep 13, 2019

This makes tp_dictoffset and tp_weaklistoffset completely opaque for C heap allocated types created through PyType_FromSpec.

The type system already provides a way to pass in readonly primitive types. This uses that mechanism to pass in the offset values through the two keywords: __dictoffset__ and __weaklistoffset__. This then extends the type system to sniff for these values to set the offsets into the type.

To provide uniformity, the passed in member types are required to have a T_PYSSIZET as well as being READONLY

https://bugs.python.org/issue38140

@DinoV DinoV requested a review from encukou September 14, 2019 14:10
@DinoV DinoV merged commit 3368f3c into python:master Sep 19, 2019
@bedevere-bot
Copy link

@DinoV: Please replace # with GH- in the commit message next time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants