8000 bpo-39943: Keep constness of pointer objects. by petdance · Pull Request #19186 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

bpo-39943: Keep constness of pointer objects. #19186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

bpo-39943: Keep constness of pointer objects. #19186

wants to merge 1 commit into from

Conversation

petdance
Copy link
Contributor
@petdance petdance commented Mar 27, 2020

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

Also moved an auto variable that got consted into its innermost
necessary scope.
@@ -625,7 +625,7 @@ type_get_bases(PyTypeObject *type, void *context)

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 *);
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. I know we've discussed before, but this was an old branch. Sorry. I'll resubmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0