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

bpo-1635741: Port _asyncio extension module to multiphase initialization(PEP 489) #18032

Open
wants to merge 2 commits into
base: master
from

Conversation

@shihai1991
Copy link
Contributor

shihai1991 commented Jan 16, 2020

@asvetlov

This comment has been minimized.

Copy link
Contributor

asvetlov commented Jan 16, 2020

Should multiphase support m_traverse/m_clear along with m_free?

@shihai1991

This comment has been minimized.

Copy link
Contributor Author

shihai1991 commented Jan 17, 2020

Should multiphase support m_traverse/m_clear along with m_free?

From pep 489: If the Py_mod_create function does not return a module subclass, then m_size must be 0, and m_traverse, m_clear and m_free must all be NULL. Otherwise, SystemError is raised.

Looks I overlooked the detail.

@shihai1991

This comment has been minimized.

Copy link
Contributor Author

shihai1991 commented Jan 18, 2020

@asvetlov Hi, andrew. I checked pep 0489 again. IMHO, supporting m_traverse/m_clear should be pep 3121's content.

cc @encukou @Dormouse759

@asvetlov

This comment has been minimized.

Copy link
Contributor

asvetlov commented Jan 18, 2020

My question is not about the exact PEP number but the correctness.
Currently, _asyncio has very many static C variables to keep references to other Python objects.
From my understanding, multiphase compatible module should support releasing these resources by m_free call. Since stored objects potentially can make cycles, m_traverse and m_clear are required as well.
Did I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.