The Wayback Machine - https://web.archive.org/web/20221223133418/https://github.com/python/cpython/pull/19044
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 itertools module to multiphase initialization. #19044

Merged
merged 4 commits into from Mar 17, 2020

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Mar 17, 2020

@corona10 corona10 requested a review from vstinner Mar 17, 2020
@corona10
Copy link
Member Author

corona10 commented Mar 17, 2020

@shihai1991 Can you please take a look?

Copy link
Member

@vstinner vstinner left a comment

LGTM. But I will wait for @shihai1991 review ;-)

Modules/itertoolsmodule.c Outdated Show resolved Hide resolved
Modules/itertoolsmodule.c Outdated Show resolved Hide resolved
@vstinner
Copy link
Member

vstinner commented Mar 17, 2020

You forgot a typelist[i], I fixed it ;-)

Copy link
Member

@shihai1991 shihai1991 left a comment

LGTM ;)

@corona10
Copy link
Member Author

corona10 commented Mar 17, 2020

You forgot a typelist[i], I fixed it ;-)

Thanks :)

@shihai1991
Copy link
Member

shihai1991 commented Mar 17, 2020

there is one thing to be confirmed: race condition of identifier in typelists can be avoid too? no potential risk?

@corona10
Copy link
Member Author

corona10 commented Mar 17, 2020

there is one thing to be confirmed: race condition of identifier in typelists can be avoid too? no potential risk?

Can you explain more concrete situation?

@vstinner
Copy link
Member

vstinner commented Mar 17, 2020

there is one thing to be confirmed: race condition of identifier in typelists can be avoid too? no potential risk?

Currently, the GIL magically protects C extensions against race conditions. But the GIL can be released when executing arbitrary code. I don't think that it's the case here.

@vstinner
Copy link
Member

vstinner commented Mar 17, 2020

Static types initialized by PyType_Ready() are bad. Types allocated on the heap using PyType_FromSpec() are better:
https://pythoncapi.readthedocs.io/type_object.html

But this should be addressed in a separated change ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants