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 _csv to multi-phase init #22838

Closed
wants to merge 2 commits into from

Conversation

encukou
Copy link
Member

@encukou encukou commented Oct 20, 2020

This PR depends on #22835 and shows how the new _PyType_GetModuleByDef can be used. I would love these to go in as two separate commits.

https://bugs.python.org/issue1635741

encukou and others added 2 commits October 20, 2020 22:45
Uses code from: python#16078

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
Co-authored-by: Hai Shi <shihai1992@gmail.com>
assert(PyType_Check(type));
assert(type->tp_mro);
int i;
for (i = 0; i < PyTuple_GET_SIZE(type->tp_mro); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to call PyTuple_GET_SIZE before the for loop to only call it once.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a macro for direct field access, so it doesn't really matter.

@encukou encukou requested review from vsajip, warsaw and a team as code owners November 10, 2020 13:53
@encukou encukou changed the base branch from 3.9 to master November 10, 2020 13:53
@encukou
Copy link
Member Author

encukou commented Nov 10, 2020

Apologies for the mass review requests. I'll open a new PR.

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

Successfully merging this pull request may close these issues.

4 participants