[WIP] bpo-1635741: Port _collections module to multiphase initialization.#19071
Closed
corona10 wants to merge 1 commit intopython:masterfrom
Closed
[WIP] bpo-1635741: Port _collections module to multiphase initialization.#19071corona10 wants to merge 1 commit intopython:masterfrom
corona10 wants to merge 1 commit intopython:masterfrom
Conversation
corona10
commented
Mar 19, 2020
Modules/_collectionsmodule.c
Outdated
Member
Author
There was a problem hiding this comment.
@vstinner I'd like to create a new helper function for this.
This logic can be reused.
https://github.com/python/cpython/blob/514c469719f149e1722a91a9d0c63bf89dfefb2a/Modules/itertoolsmodule.c#L4733L4747
What do you think?
Member
There was a problem hiding this comment.
Do you mean combine PyType_Ready + _PyType_Name + PyModule_AddObject? Yeah, maybe it's worth it, but I would prefer to add it once this PR lands.
58e7344 to
fb35d81
Compare
vstinner
reviewed
Mar 19, 2020
| &PyODict_Type, | ||
| &dequeiter_type, | ||
| &dequereviter_type, | ||
| &tuplegetter_type, |
Member
There was a problem hiding this comment.
Either you use Py_ARRAY_COUNT() to get the list length, or you need to add a NULL terminator. Currently, you rely on an undefined behavior.
Member
|
FWIW, some comments in https://github.com/python/cpython/pull/18066/files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://bugs.python.org/issue1635741