-
Notifications
You must be signed in to change notification settings - Fork 71
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
PEP489 support: multi-phase module initialization, heap based types #307
Commits on May 23, 2024
-
refactor: one static decl per line
Sort the constant string decls from the ones to be moved to module state.
Configuration menu - View commit details
-
Copy full SHA for f365aff - Browse repository at this point
Copy the full SHA f365affView commit details -
feat: add struct for module state
Include methods for initializing, traversing, and clearing it. Tidy up module method defs w/ constant docstrings.
Configuration menu - View commit details
-
Copy full SHA for c2f31b1 - Browse repository at this point
Copy the full SHA c2f31b1View commit details -
feat: wire module state into module def
Use named members for clarity.
Configuration menu - View commit details
-
Copy full SHA for 14a68b1 - Browse repository at this point
Copy the full SHA 14a68b1View commit details -
refactor: return state pointer from 'zic_state_init'
Tidy spelings for pointer vars.
Configuration menu - View commit details
-
Copy full SHA for 7d003c1 - Browse repository at this point
Copy the full SHA 7d003c1View commit details -
refactor: outline multi-phase initialization
- Store created objects in the module state first, then copy them where they are needed (in the future, into the module's __dict__ so that Python can use them). - At this point, the module and the types are still all static. - Use 'PyModule_AddType' as a clearer statement of intent. We are going to be creating the types on the heap later, and so will have their addresses to hand.
Configuration menu - View commit details
-
Copy full SHA for 61c3abb - Browse repository at this point
Copy the full SHA 61c3abbView commit details -
Configuration menu - View commit details
-
Copy full SHA for de30f27 - Browse repository at this point
Copy the full SHA de30f27View commit details -
feat: add module-state version of 'import_declarations'
- Stores imported values and flag on the module state struct, rather than in global statics.
Configuration menu - View commit details
-
Copy full SHA for f2e6838 - Browse repository at this point
Copy the full SHA f2e6838View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b092d9 - Browse repository at this point
Copy the full SHA 7b092d9View commit details -
refactor: use 'PyObject_GetAttrString'
Drop statics previously used to call 'PyObject_GetAttr'.
Configuration menu - View commit details
-
Copy full SHA for fc38083 - Browse repository at this point
Copy the full SHA fc38083View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f5814d - Browse repository at this point
Copy the full SHA 4f5814dView commit details -
chore: restore compat w/ Python < 3.10
The 'PyModule_AddType' API was added in that release.
Configuration menu - View commit details
-
Copy full SHA for 6fc0d08 - Browse repository at this point
Copy the full SHA 6fc0d08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e1387e - Browse repository at this point
Copy the full SHA 6e1387eView commit details -
refactor: use 'PyDict_GetItemString'
And remove the static used to call 'PyDict_GetItem'.
Configuration menu - View commit details
-
Copy full SHA for 2c4d70c - Browse repository at this point
Copy the full SHA 2c4d70cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 011a705 - Browse repository at this point
Copy the full SHA 011a705View commit details -
refactor: always pass the module to the module-scope functions
Note that those functions are still ignoring that value: this is prep for the next step, where they will use the '_zic_module_state' machinery
Configuration menu - View commit details
-
Copy full SHA for 5638a90 - Browse repository at this point
Copy the full SHA 5638a90View commit details -
refactor: move module-scope functions to end
Leave forward decls behind FBO type methods. This step is in preparation for using the '_zic_module_state', rather than the global statics.
Configuration menu - View commit details
-
Copy full SHA for f7b2889 - Browse repository at this point
Copy the full SHA f7b2889View commit details -
fix: use API to get initialized module from spec
This is a stopgap, for the statically-initialized module. It will be replaced by 'PyType_GetModuleByDef' once we have multi-phase init and heap types in place.
Configuration menu - View commit details
-
Copy full SHA for 2b331f9 - Browse repository at this point
Copy the full SHA 2b331f9View commit details -
refactor: remove statics loaded from 'z.i.declarations'
Instead, look them up via module state versions.
Configuration menu - View commit details
-
Copy full SHA for 8b55439 - Browse repository at this point
Copy the full SHA 8b55439View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02f56e0 - Browse repository at this point
Copy the full SHA 02f56e0View commit details -
refactor: remove global static 'adapter_hooks'
Look it up instead from module state via type with a new helper, '_get_adapter_hooks'.
Configuration menu - View commit details
-
Copy full SHA for c573b27 - Browse repository at this point
Copy the full SHA c573b27View commit details -
refactor: reorder statics above forwards
Move actual explanatory comment for '_get_adapter_hooks' to its impl.
Configuration menu - View commit details
-
Copy full SHA for 80ed5e1 - Browse repository at this point
Copy the full SHA 80ed5e1View commit details -
refactor: disuse static 'SpecificationBaseType'
Look it up instead from from module state via the type with a new helper, '_get_specification_base_class'.
Configuration menu - View commit details
-
Copy full SHA for baf7991 - Browse repository at this point
Copy the full SHA baf7991View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c5e0ea - Browse repository at this point
Copy the full SHA 1c5e0eaView commit details -
refactor: multi-phase module init + heap types
At least one bug remains (some interfaces return a 'member_descriptor' for their '__module__').
Configuration menu - View commit details
-
Copy full SHA for e3f947b - Browse repository at this point
Copy the full SHA e3f947bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e315d8 - Browse repository at this point
Copy the full SHA 0e315d8View commit details -
refactor: use 'Py_TPFLAGS_MANAGED_WEAKREF' everywhere
Drop vestiges of manual 'weakreflist' management. Rename type structs and methods for consistency.
Configuration menu - View commit details
-
Copy full SHA for 4b3e9db - Browse repository at this point
Copy the full SHA 4b3e9dbView commit details -
refactor: macros for type flags
Make them conditional, along with the manual weakreflist managerment, on Python < 3.12, which added the 'Py_TPFLAGS_MANAGED_WEAKREF' flag. Builds and tests pass on 3.11 with this change.
Configuration menu - View commit details
-
Copy full SHA for 5de904c - Browse repository at this point
Copy the full SHA 5de904cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c642bb0 - Browse repository at this point
Copy the full SHA c642bb0View commit details
Commits on May 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8d9086c - Browse repository at this point
Copy the full SHA 8d9086cView commit details
Commits on May 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a03b255 - Browse repository at this point
Copy the full SHA a03b255View commit details
Commits on May 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 45f086d - Browse repository at this point
Copy the full SHA 45f086dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bb0ee6 - Browse repository at this point
Copy the full SHA 2bb0ee6View commit details
Commits on May 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bcc27b7 - Browse repository at this point
Copy the full SHA bcc27b7View commit details -
perf: re-intern hot-path getattr names
'PyObject_GetAttrString' creates new string objects from 'char*'.
Configuration menu - View commit details
-
Copy full SHA for bc55fcb - Browse repository at this point
Copy the full SHA bc55fcbView commit details
Commits on Jun 12, 2024
-
refactor: limit special-case handling to 'InterfaceBase'
Member descriptor behavior is tricky across Python versions, and across static vs. heap-allocated types. The 'InterfaceBase' base type is a singleton, and has a known/desired "implements name".
Configuration menu - View commit details
-
Copy full SHA for 61a84a1 - Browse repository at this point
Copy the full SHA 61a84a1View commit details
Commits on Aug 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e0558d7 - Browse repository at this point
Copy the full SHA e0558d7View commit details -
chore: document version hex usage
Co-authored-by: David Glick <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e173384 - Browse repository at this point
Copy the full SHA e173384View commit details -
chore: drop use of obscure acronym in comment
Co-authored-by: David Glick <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ee3efff - Browse repository at this point
Copy the full SHA ee3efffView commit details -
chore: another acronym bites the dust
Co-authored-by: David Glick <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 743903d - Browse repository at this point
Copy the full SHA 743903dView commit details -
Co-authored-by: David Glick <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d6f5640 - Browse repository at this point
Copy the full SHA d6f5640View commit details -
Merge branch 'tseaver-rework_pep_489' of github.com:zopefoundation/zo…
…pe.interface into tseaver-rework_pep_489
Configuration menu - View commit details
-
Copy full SHA for 21603e6 - Browse repository at this point
Copy the full SHA 21603e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25d664a - Browse repository at this point
Copy the full SHA 25d664aView commit details -
refactor: use named flag for explicit weakref lists
Rather than checking the Python version repeatedly. See: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_weaklistoffset
Configuration menu - View commit details
-
Copy full SHA for 6bb37a5 - Browse repository at this point
Copy the full SHA 6bb37a5View commit details
Commits on Aug 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c35f95e - Browse repository at this point
Copy the full SHA c35f95eView commit details