{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
gh-117142: Port _ctypes to multi-phase init #117181
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
9f64b8d
add test
neonene 22d291c
multi phase init
neonene c63737e
_PyType_GetModuleState() for CField,CThunk
neonene 6a775bc
PyType_GetModuleByDef() for cast()
neonene 622e09d
get_module_state()
neonene 5dae271
get_module_state_by_def(Py_TYPE(Py_TYPE(obj)))
neonene 2263f82
get_module_state_by_def(Py_TYPE(type))
neonene 1877767
split GenericPyCData_new()
neonene 6d97625
move global vars to module state
neonene 6a09cad
prepend module state to func args
neonene c24df4d
fix typos
neonene 678ffa0
ignored.tsv
neonene 83ec018
_PyType_GetModuleState() with assert
neonene 012f8b8
get_module_state_by_cls -> _by_class
neonene 28696c2
assert(module) in create_pointer_type()
neonene a228d35
sync styles with #117189
neonene 03c1f79
Merge branch 'main' into ctypes_multi2
neonene de5110f
📜🤖 Added by blurb_it.
blurb-it[bot] 4d69bdc
PyType_GetModuleByDef() for fini
neonene f2655eb
fix warning
neonene afb0308
Merge branch 'main' into ctypes_multi2
neonene b5932ca
correct merge confict resolution
neonene 737f29e
Use Argument Clinic and the defining_class for __sizeof__
encukou 96bebd0
edit blank
neonene 5d7ac4b
AC1: module, class, special cases
neonene 0bf6ad9
AC2: the others
neonene 149d3a0
apply suggested AC conv (CType_Type)
neonene 3b89673
Merge branch 'main' into ctypes_multi2
neonene ef428a7
Merge branch 'ctypes_multi2' into ctypes_multi2
neonene 2755d92
Merge pull request #1 from encukou/ctypes_multi2
neonene 1042696
add missing test.support.script_helper
neonene 8107885
AC: split class imputs
neonene bcdf867
periods
neonene cd97939
Merge branch 'main' into ctypes_multi2
neonene 39c91b4
update AC checksums
neonene 5db3c42
fill type names
neonene 5d09e4e
Merge branch 'main' into ctypes_multi2
neonene 8da8b43
Merge branch 'main' into ctypes_multi2
neonene 40cec34
AC: class default module state getters
neonene 893a981
typo
neonene 807c6c0
move define up
neonene f58ed21
Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED
neonene cb88db3
Move PyGILState_Ensure/Release
neonene 4237557
fix a comment
neonene 4802eb0
Merge branch 'main' into ctypes_multi2
neonene 03cffa9
change NEWS (PEP 687 -> 489)
neonene 76a2b8c
typo
neonene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
AC: split class imputs
- Loading branch information
commit 8107885fa590879f8966648750737c4bd8bcf904
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I've used the practice of defining a "clinic state" macro for getting the module state in generated clinic code. It has proven useful if you want to tweak stuff afterwards (smaller diffs, less churn). You can
git grep clinic_state **/*.cfor inspiration.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC,
*_impl()should be passed a module state if the AC gets it in advance with some overhead. Also,_ctypeswould need a module state getter to be specified in each function clinic input, making a class input have a type name without any operator, EDIT: or making the getter returnst.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah,
_PyType_GetModuleState(cls)or_PyType_GetModuleState(cls->tp_base)can be applied to each class. I'll try.