Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented Mar 19, 2020

@corona10
Copy link
MemberAuthor

corona10 commented Mar 19, 2020

For the record, I will work on a new helper function after this PR is landed if this work is worth to do.
#19071 (comment)

@corona10corona10 requested a review from vstinnerMarch 19, 2020 15:40
@corona10
Copy link
MemberAuthor

@shihai1991 Please take a look :)

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM apart "m" variable name which looks too short to me ;-)

if (PyType_Ready(type) <0){
return-1;
}
constchar*name=_PyType_Name(type);
Copy link
Member

Choose a reason for hiding this comment

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

FYI I checked manually that the actual type name and _PyType_Name() gives the same name than before this change.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I did same thing also :) Thank you for the re-checking!

}
constchar*name=_PyType_Name(type);
Py_INCREF(type);
if (PyModule_AddObject(m, name, (PyObject*)type) <0){
Copy link
Member

Choose a reason for hiding this comment

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

Checking for PyModule_AddObject() error is a good thing ;-)

};

staticint
collections_exec(PyObject*m){
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: would you mind to rename it to "mod" or "module"?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

module might be great! Thanks for the suggestion

@shihai1991
Copy link
Member

oh, on~ my network crashed at this point :(
I can not review codes now, waiting a moment~


defdict_type.tp_base=&PyDict_Type;

for (inti=0; typelist[i] !=NULL; i++){
Copy link
Member

Choose a reason for hiding this comment

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

nice improvment.

Copy link
Member

@shihai1991shihai1991 left a comment

Choose a reason for hiding this comment

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

I like the improvment of typelist.
LGTM :)

@corona10
Copy link
MemberAuthor

@vstinner@shihai1991

Thanks for the reviews :)

@vstinnervstinner merged commit 77248a2 into python:masterMar 19, 2020
@corona10corona10 deleted the bpo-1635741-_collectionsmodule branch March 31, 2020 12:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@corona10@shihai1991@vstinner@the-knights-who-say-ni@bedevere-bot