Skip to content

Use multi-phase initialisation (PEP 489) #345

Description

@jinh-labs

CPython has recommended multi-phase initialization over legacy single-phase initialization (PyModule_Create) since Python 3.5.

Multi-phase init is also the prerequisite for sub-interpreter support: C extension modules that use single-phase init can't be imported into sub-interpreters created with concurrent.interpreters. The import fails with:

ImportError: module <name> does not support loading in subinterpreters

Thanks,
Jin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions