Skip to content

RFC: redefine PyTypeObjects as heap types for Limited API compliance#154

Draft
neutrinoceros wants to merge 2 commits intobrandon-rhodes:masterfrom
neutrinoceros:rfc/heaptypes
Draft

RFC: redefine PyTypeObjects as heap types for Limited API compliance#154
neutrinoceros wants to merge 2 commits intobrandon-rhodes:masterfrom
neutrinoceros:rfc/heaptypes

Conversation

@neutrinoceros
Copy link

@neutrinoceros neutrinoceros commented Mar 11, 2026

based off #153
needed for #151

At the time of opening, I'm getting a single compilation error:

clang++: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument]
extension/wrapper.cpp:582:10: error: use of undeclared identifier 'Py_tp_as_sequence'
  582 |         {Py_tp_as_sequence, &SatrecArray_as_sequence},

I don't have experience with "sub slots", which seem needed for defining the tp_as_sequence slot correctly. Hopefully I can crack it soon but in the mean time, any help would be appreciated.

@neutrinoceros
Copy link
Author

maybe the rabbit hole goes a lot deeper. I think this is just the first symptom of a much broader issue: SatrecArrayType is the first type of variable lenght that I attempt to convert to a heap type. I'm almost sure it should be possible, but I may be slow to reach a conclusion/solution.

@neutrinoceros
Copy link
Author

FWIW I doubt that this change can be handled simply without dropping Python 2.7 too, but I also don't have a simple way to check.

@neutrinoceros
Copy link
Author

... which might not be a problem since, IIUC, the extension is only ever compiled for Python 3 anyway

@neutrinoceros
Copy link
Author

I got it to compile locally. Hopefully it runs smoothly in CI too.

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.

1 participant