bpo-39943: Keep constness of pointer objects.#19186
Closed
petdance wants to merge 1 commit intopython:masterfrom
petdance:const-Objects-typeobject
Closed
bpo-39943: Keep constness of pointer objects.#19186petdance wants to merge 1 commit intopython:masterfrom petdance:const-Objects-typeobject
petdance wants to merge 1 commit intopython:masterfrom
petdance:const-Objects-typeobject
Conversation
Also moved an auto variable that got consted into its innermost necessary scope.
| static PyTypeObject *best_base(PyObject *); | ||
| static int mro_internal(PyTypeObject *, PyObject **); | ||
| static int type_is_subtype_base_chain(PyTypeObject *, PyTypeObject *); | ||
| static int type_is_subtype_base_chain(const PyTypeObject *, const PyTypeObject *); |
Member
There was a problem hiding this comment.
Please do not add const to PyObject pointers (and PyTypeObject is a subtype of PyObject). They are inherently mutable. If the particular function does not mutate them in the particular Python version, it is just an implementation detail.
Contributor
Author
There was a problem hiding this comment.
Will do. I know we've discussed before, but this was an old branch. Sorry. I'll resubmit.
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.
Also moved an auto variable that got consted into its innermost
necessary scope.
Note that this is the same type of patch as #19185, but in a different source file. If it's easier for the folks that go through these patches to have similar changes to multiple source files put together in one PR, let me know and I'll do that going forward.
https://bugs.python.org/issue39943