cpython: 763af3d957f3 (original) (raw)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -568,6 +568,9 @@ Tools/Demos Build ----- +- Issue #19356: Avoid using a C variabled named "_self", it's a reserved

--- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -143,18 +143,18 @@ typedef struct { } DictRemoverObject; static void -_DictRemover_dealloc(PyObject *_self) +_DictRemover_dealloc(PyObject *myself) {

} static PyObject * -_DictRemover_call(PyObject *_self, PyObject *args, PyObject *kw) +_DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw) {

@@ -2471,17 +2471,17 @@ static PyMemberDef PyCData_members[] = { { NULL }, }; -static int PyCData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags) +static int PyCData_NewGetBuffer(PyObject *myself, Py_buffer *view, int flags) {

static PyObject * -PyCData_reduce(PyObject *_self, PyObject *args) +PyCData_reduce(PyObject *myself, PyObject *args) {

-

+

} static PyObject * -PyCData_setstate(PyObject *_self, PyObject *args) +PyCData_setstate(PyObject *myself, PyObject *args) { void *data; Py_ssize_t len; int res; PyObject *dict, *mydict;

static PyObject * -Array_item(PyObject *_self, Py_ssize_t index) +Array_item(PyObject *myself, Py_ssize_t index) {

static PyObject * -Array_subscript(PyObject *_self, PyObject *item) +Array_subscript(PyObject *myself, PyObject *item) {

if (PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); @@ -4220,7 +4220,7 @@ Array_subscript(PyObject *_self, PyObjec return NULL; if (i < 0) i += self->b_length;

@@ -4297,7 +4297,7 @@ Array_subscript(PyObject *_self, PyObjec for (cur = start, i = 0; i < slicelen; cur += step, i++) {

@@ -4311,9 +4311,9 @@ Array_subscript(PyObject *_self, PyObjec } static int -Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value) +Array_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value) {

static int -Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value) +Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value) {

if (value == NULL) { PyErr_SetString(PyExc_TypeError, @@ -4357,7 +4357,7 @@ Array_ass_subscript(PyObject *_self, PyO return -1; if (i < 0) i += self->b_length;

@@ -4382,7 +4382,7 @@ Array_ass_subscript(PyObject *_self, PyO int result; if (item == NULL) return -1;

@@ -4397,9 +4397,9 @@ Array_ass_subscript(PyObject *_self, PyO } static Py_ssize_t -Array_length(PyObject *_self) +Array_length(PyObject *myself) {

@@ -4685,9 +4685,9 @@ static PyTypeObject Simple_Type = { PyCPointer_Type */ static PyObject * -Pointer_item(PyObject *_self, Py_ssize_t index) +Pointer_item(PyObject *myself, Py_ssize_t index) {

static int -Pointer_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value) +Pointer_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value) {

static PyObject * -Pointer_subscript(PyObject *_self, PyObject *item) +Pointer_subscript(PyObject *myself, PyObject *item) {

@@ -4968,7 +4968,7 @@ Pointer_subscript(PyObject *_self, PyObj return NULL; for (cur = start, i = 0; i < len; cur += step, i++) {

--- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -10,9 +10,9 @@ /**************************************************************/ static void -CThunkObject_dealloc(PyObject *_self) +CThunkObject_dealloc(PyObject *myself) {

static int -CThunkObject_traverse(PyObject *_self, visitproc visit, void *arg) +CThunkObject_traverse(PyObject *myself, visitproc visit, void *arg) {

static int -CThunkObject_clear(PyObject *_self) +CThunkObject_clear(PyObject *myself) {

--- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -809,9 +809,9 @@ element_deepcopy(ElementObject* self, Py } static PyObject* -element_sizeof(PyObject* _self, PyObject* args) +element_sizeof(PyObject* myself, PyObject* args) {

--- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -282,12 +282,12 @@ check_decoded(PyObject *decoded) #define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF) PyObject * -_PyIncrementalNewlineDecoder_decode(PyObject *_self, +_PyIncrementalNewlineDecoder_decode(PyObject *myself, PyObject *input, int final) { PyObject *output; Py_ssize_t output_len;

if (self->decoder == NULL) { PyErr_SetString(PyExc_ValueError,