Skip to content

bpo-1635741: Port _csv to multi-phase init - #22838

Closed
encukou wants to merge 2 commits into
python:masterfrom
encukou:pep-573-walker-and-csv
Closed

bpo-1635741: Port _csv to multi-phase init#22838
encukou wants to merge 2 commits into
python:masterfrom
encukou:pep-573-walker-and-csv

Conversation

@encukou

@encukou encukou commented Oct 20, 2020

Copy link
Copy Markdown
Member

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>
Comment thread Objects/typeobject.c
assert(PyType_Check(type));
assert(type->tp_mro);
int i;
for (i = 0; i < PyTuple_GET_SIZE(type->tp_mro); i++) {

Copy link
Copy Markdown
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
Copy Markdown
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 a team, vsajip and warsaw 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

encukou commented Nov 10, 2020

Copy link
Copy Markdown
Member Author

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

4 participants