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 _weakref extension module to multiphase initialization(PEP 489) #19084

Merged
merged 2 commits into from Mar 20, 2020

Conversation

@shihai1991
Copy link
Contributor

shihai1991 commented Mar 20, 2020

if (PyModule_AddObject(module, "ref", (PyObject *) &_PyWeakref_RefType) < 0) {
Py_DECREF(&_PyWeakref_RefType);
return -1;
}

This comment has been minimized.

Copy link
@vstinner

vstinner Mar 20, 2020

Member

@corona10: Ah, now I see that we would benefit of a helper function calling PyType_Ready() + _PyType_Name() + PyModule_AddObject() ;-)

This comment has been minimized.

Copy link
@corona10

corona10 Mar 20, 2020

Member

I will submit the PR for this :)

This comment has been minimized.

Copy link
@shihai1991

shihai1991 Mar 20, 2020

Author Contributor

I am looking forword this feature;)
In this case, _PyWeakref_RefType have been added much times(it is means this type have much objects name). it can use this feature too?

@vstinner vstinner merged commit 8334f30 into python:master Mar 20, 2020
8 of 9 checks passed
8 of 9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200320.7 succeeded
Details
bedevere/issue-number Issue number 1635741 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@shihai1991

This comment has been minimized.

Copy link
Contributor Author

shihai1991 commented Mar 20, 2020

thanks, folks.

vstinner added a commit to vstinner/cpython that referenced this pull request Mar 23, 2020
vstinner added a commit to vstinner/cpython that referenced this pull request Mar 23, 2020
…tialization (PEP 489) (pythonGH-19084)"

bpo-1635741, bpo-40050: This reverts
commit 8334f30.
vstinner added a commit that referenced this pull request Mar 23, 2020
…tialization (PEP 489) (GH-19084)" (#19128)

bpo-1635741, bpo-40050: This reverts
commit 8334f30.
@vstinner

This comment has been minimized.

Copy link
Member

vstinner commented Mar 23, 2020

I had to revert this change: #19128

Because it introduced a reference leak: https://bugs.python.org/issue40050

vstinner added a commit to vstinner/cpython that referenced this pull request Mar 24, 2020
vstinner added a commit to vstinner/cpython that referenced this pull request Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.