GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-1635741: Port _collections module to multiphase initialization. by corona10 · Pull Request #19074 · python/cpython Conversation
|
|
For the record, I will work on a new helper function after this PR is landed if this work is worth to do. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@shihai1991 Please take a look :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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 ;-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (PyType_Ready(type) < 0) { | ||
| return -1; | ||
| } | ||
| const char *name = _PyType_Name(type); |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| const char *name = _PyType_Name(type); | ||
| Py_INCREF(type); | ||
| if (PyModule_AddObject(m, name, (PyObject *)type) < 0) { |
There was a problem 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 ;-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| }; | ||
|
|
||
| static int | ||
| collections_exec(PyObject *m) { |
There was a problem 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"?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
module might be great! Thanks for the suggestion
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
oh, on~ my network crashed at this point :( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| defdict_type.tp_base = &PyDict_Type; | ||
|
|
||
| for (int i = 0; typelist[i] != NULL; i++) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nice improvment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I like the improvment of typelist.
LGTM :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the reviews :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.