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

RFC: Implement Multi-Phase Module Initialization as per PEP 489 #4162

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Jul 23, 2024

  1. impl: add module pymodule_state

    This module contains `ModuleState`, a struct used to represent state
    that lies on the per-module memory region of a Python module, as well
    as various exported functions that are used to integrate `ModuleState`
    with the Python interpreter.
    
    This commit does not implement any further functionality (such as
    actually representing any kind of state) and is instead more of a
    blank slate for further additions.
    
    Signed-off-by: Max R. Carrara <aequitosh@gmail.com>
    Aequitosh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    9290fc3 View commit details
    Browse the repository at this point in the history
  2. impl: add helpers for runtime static allocation

    These helpers and wrapper structs ensure that any slots and function
    pointers used during multi-phase initialization stay allocated
    throughout the remaining lifetime of the program.
    
    Signed-off-by: Max R. Carrara <aequitosh@gmail.com>
    Aequitosh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    8749371 View commit details
    Browse the repository at this point in the history
  3. add experimental support for PEP 489 multi-phase module initialization

    This commit adds experimental but fully functional support for
    multi-phase module initialization as specified in PEP 489.
    
    Note that this commit serves as a demonstration & basis for further
    improvements only; many tests have therefore not been adapted
    correspondingly yet.
    
    Signed-off-by: Max R. Carrara <aequitosh@gmail.com>
    Aequitosh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    bb977a1 View commit details
    Browse the repository at this point in the history
  4. (TODO) pymodule: use multi-phase initialization in PyModule::new_bound

    Signed-off-by: Max R. Carrara <aequitosh@gmail.com>
    Aequitosh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    a1beab4 View commit details
    Browse the repository at this point in the history