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

MAINT: Use PyConfig to configure python interpreter #1118

Merged
merged 4 commits into from
Jan 12, 2021

Conversation

hoodmane
Copy link
Member

Prior to Python 3.8, configuring Python was an ad-hoc process. PEP 587 added a systematic way to configure Python. Using this leads to simpler, clearer code with compile time checking for the config fields, better error handling and more discoverable documentation.

For example, in Py_InitializeEx(0) the 0 means "don't install signal handlers". This is opaque and requires looking Py_InitializeEx in the docs to interpret. (Of course a comment could fix that.) Instead we now say:

config.install_signal_handlers = false;

@hoodmane hoodmane changed the title Use PyConfig to configure python MAINT: Use PyConfig to configure python Jan 11, 2021
@hoodmane hoodmane changed the title MAINT: Use PyConfig to configure python MAINT: Use PyConfig to configure python interpreter Jan 11, 2021
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nicer indeed! Thanks!

@rth rth merged commit cf7cbd4 into pyodide:master Jan 12, 2021
@hoodmane hoodmane deleted the init-config branch January 12, 2021 22:21
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.

2 participants