Issue #19356: Avoid using a C variabled named "_self", it's a reserved word in some C compilers.
This commit is contained in:
commit
4d397008cd
@ -52,6 +52,12 @@ Library
|
|||||||
|
|
||||||
- Issue #17087: Improved the repr for regular expression match objects.
|
- Issue #17087: Improved the repr for regular expression match objects.
|
||||||
|
|
||||||
|
Build
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
|
||||||
|
word in some C compilers.
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 3.4.0 Alpha 4?
|
What's New in Python 3.4.0 Alpha 4?
|
||||||
===================================
|
===================================
|
||||||
@ -655,7 +661,6 @@ Tools/Demos
|
|||||||
- Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
|
- Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
|
||||||
their version strings to stdout, and not to sderr.
|
their version strings to stdout, and not to sderr.
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 3.4.0 Alpha 1?
|
What's New in Python 3.4.0 Alpha 1?
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
|
@ -143,18 +143,18 @@ typedef struct {
|
|||||||
} DictRemoverObject;
|
} DictRemoverObject;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_DictRemover_dealloc(PyObject *_self)
|
_DictRemover_dealloc(PyObject *myself)
|
||||||
{
|
{
|
||||||
DictRemoverObject *self = (DictRemoverObject *)_self;
|
DictRemoverObject *self = (DictRemoverObject *)myself;
|
||||||
Py_XDECREF(self->key);
|
Py_XDECREF(self->key);
|
||||||
Py_XDECREF(self->dict);
|
Py_XDECREF(self->dict);
|
||||||
Py_TYPE(self)->tp_free(_self);
|
Py_TYPE(self)->tp_free(myself);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
_DictRemover_call(PyObject *_self, PyObject *args, PyObject *kw)
|
_DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
DictRemoverObject *self = (DictRemoverObject *)_self;
|
DictRemoverObject *self = (DictRemoverObject *)myself;
|
||||||
if (self->key && self->dict) {
|
if (self->key && self->dict) {
|
||||||
if (-1 == PyDict_DelItem(self->dict, self->key))
|
if (-1 == PyDict_DelItem(self->dict, self->key))
|
||||||
/* XXX Error context */
|
/* XXX Error context */
|
||||||
@ -2451,17 +2451,17 @@ static PyMemberDef PyCData_members[] = {
|
|||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int PyCData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags)
|
static int PyCData_NewGetBuffer(PyObject *myself, Py_buffer *view, int flags)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
StgDictObject *dict = PyObject_stgdict(_self);
|
StgDictObject *dict = PyObject_stgdict(myself);
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
|
|
||||||
if (view == NULL) return 0;
|
if (view == NULL) return 0;
|
||||||
|
|
||||||
view->buf = self->b_ptr;
|
view->buf = self->b_ptr;
|
||||||
view->obj = _self;
|
view->obj = myself;
|
||||||
Py_INCREF(_self);
|
Py_INCREF(myself);
|
||||||
view->len = self->b_size;
|
view->len = self->b_size;
|
||||||
view->readonly = 0;
|
view->readonly = 0;
|
||||||
/* use default format character if not set */
|
/* use default format character if not set */
|
||||||
@ -2496,36 +2496,36 @@ PyCData_nohash(PyObject *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyCData_reduce(PyObject *_self, PyObject *args)
|
PyCData_reduce(PyObject *myself, PyObject *args)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
|
|
||||||
if (PyObject_stgdict(_self)->flags & (TYPEFLAG_ISPOINTER|TYPEFLAG_HASPOINTER)) {
|
if (PyObject_stgdict(myself)->flags & (TYPEFLAG_ISPOINTER|TYPEFLAG_HASPOINTER)) {
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
"ctypes objects containing pointers cannot be pickled");
|
"ctypes objects containing pointers cannot be pickled");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return Py_BuildValue("O(O(NN))",
|
return Py_BuildValue("O(O(NN))",
|
||||||
_unpickle,
|
_unpickle,
|
||||||
Py_TYPE(_self),
|
Py_TYPE(myself),
|
||||||
PyObject_GetAttrString(_self, "__dict__"),
|
PyObject_GetAttrString(myself, "__dict__"),
|
||||||
PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
|
PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyCData_setstate(PyObject *_self, PyObject *args)
|
PyCData_setstate(PyObject *myself, PyObject *args)
|
||||||
{
|
{
|
||||||
void *data;
|
void *data;
|
||||||
Py_ssize_t len;
|
Py_ssize_t len;
|
||||||
int res;
|
int res;
|
||||||
PyObject *dict, *mydict;
|
PyObject *dict, *mydict;
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
if (!PyArg_ParseTuple(args, "Os#", &dict, &data, &len))
|
if (!PyArg_ParseTuple(args, "Os#", &dict, &data, &len))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (len > self->b_size)
|
if (len > self->b_size)
|
||||||
len = self->b_size;
|
len = self->b_size;
|
||||||
memmove(self->b_ptr, data, len);
|
memmove(self->b_ptr, data, len);
|
||||||
mydict = PyObject_GetAttrString(_self, "__dict__");
|
mydict = PyObject_GetAttrString(myself, "__dict__");
|
||||||
res = PyDict_Update(mydict, dict);
|
res = PyDict_Update(mydict, dict);
|
||||||
Py_DECREF(mydict);
|
Py_DECREF(mydict);
|
||||||
if (res == -1)
|
if (res == -1)
|
||||||
@ -4163,9 +4163,9 @@ Array_init(CDataObject *self, PyObject *args, PyObject *kw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Array_item(PyObject *_self, Py_ssize_t index)
|
Array_item(PyObject *myself, Py_ssize_t index)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
Py_ssize_t offset, size;
|
Py_ssize_t offset, size;
|
||||||
StgDictObject *stgdict;
|
StgDictObject *stgdict;
|
||||||
|
|
||||||
@ -4189,9 +4189,9 @@ Array_item(PyObject *_self, Py_ssize_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Array_subscript(PyObject *_self, PyObject *item)
|
Array_subscript(PyObject *myself, PyObject *item)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
|
|
||||||
if (PyIndex_Check(item)) {
|
if (PyIndex_Check(item)) {
|
||||||
Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
|
Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
|
||||||
@ -4200,7 +4200,7 @@ Array_subscript(PyObject *_self, PyObject *item)
|
|||||||
return NULL;
|
return NULL;
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
i += self->b_length;
|
i += self->b_length;
|
||||||
return Array_item(_self, i);
|
return Array_item(myself, i);
|
||||||
}
|
}
|
||||||
else if (PySlice_Check(item)) {
|
else if (PySlice_Check(item)) {
|
||||||
StgDictObject *stgdict, *itemdict;
|
StgDictObject *stgdict, *itemdict;
|
||||||
@ -4277,7 +4277,7 @@ Array_subscript(PyObject *_self, PyObject *item)
|
|||||||
|
|
||||||
for (cur = start, i = 0; i < slicelen;
|
for (cur = start, i = 0; i < slicelen;
|
||||||
cur += step, i++) {
|
cur += step, i++) {
|
||||||
PyObject *v = Array_item(_self, cur);
|
PyObject *v = Array_item(myself, cur);
|
||||||
PyList_SET_ITEM(np, i, v);
|
PyList_SET_ITEM(np, i, v);
|
||||||
}
|
}
|
||||||
return np;
|
return np;
|
||||||
@ -4291,9 +4291,9 @@ Array_subscript(PyObject *_self, PyObject *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
|
Array_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
Py_ssize_t size, offset;
|
Py_ssize_t size, offset;
|
||||||
StgDictObject *stgdict;
|
StgDictObject *stgdict;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
@ -4320,9 +4320,9 @@ Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
|
Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
@ -4337,7 +4337,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
|
|||||||
return -1;
|
return -1;
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
i += self->b_length;
|
i += self->b_length;
|
||||||
return Array_ass_item(_self, i, value);
|
return Array_ass_item(myself, i, value);
|
||||||
}
|
}
|
||||||
else if (PySlice_Check(item)) {
|
else if (PySlice_Check(item)) {
|
||||||
Py_ssize_t start, stop, step, slicelen, otherlen, i, cur;
|
Py_ssize_t start, stop, step, slicelen, otherlen, i, cur;
|
||||||
@ -4362,7 +4362,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
|
|||||||
int result;
|
int result;
|
||||||
if (item == NULL)
|
if (item == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
result = Array_ass_item(_self, cur, item);
|
result = Array_ass_item(myself, cur, item);
|
||||||
Py_DECREF(item);
|
Py_DECREF(item);
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -4377,9 +4377,9 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Py_ssize_t
|
static Py_ssize_t
|
||||||
Array_length(PyObject *_self)
|
Array_length(PyObject *myself)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
return self->b_length;
|
return self->b_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4665,9 +4665,9 @@ static PyTypeObject Simple_Type = {
|
|||||||
PyCPointer_Type
|
PyCPointer_Type
|
||||||
*/
|
*/
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Pointer_item(PyObject *_self, Py_ssize_t index)
|
Pointer_item(PyObject *myself, Py_ssize_t index)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
Py_ssize_t size;
|
Py_ssize_t size;
|
||||||
Py_ssize_t offset;
|
Py_ssize_t offset;
|
||||||
StgDictObject *stgdict, *itemdict;
|
StgDictObject *stgdict, *itemdict;
|
||||||
@ -4696,9 +4696,9 @@ Pointer_item(PyObject *_self, Py_ssize_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Pointer_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
|
Pointer_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
Py_ssize_t size;
|
Py_ssize_t size;
|
||||||
Py_ssize_t offset;
|
Py_ssize_t offset;
|
||||||
StgDictObject *stgdict, *itemdict;
|
StgDictObject *stgdict, *itemdict;
|
||||||
@ -4828,14 +4828,14 @@ Pointer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Pointer_subscript(PyObject *_self, PyObject *item)
|
Pointer_subscript(PyObject *myself, PyObject *item)
|
||||||
{
|
{
|
||||||
CDataObject *self = (CDataObject *)_self;
|
CDataObject *self = (CDataObject *)myself;
|
||||||
if (PyIndex_Check(item)) {
|
if (PyIndex_Check(item)) {
|
||||||
Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
|
Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
|
||||||
if (i == -1 && PyErr_Occurred())
|
if (i == -1 && PyErr_Occurred())
|
||||||
return NULL;
|
return NULL;
|
||||||
return Pointer_item(_self, i);
|
return Pointer_item(myself, i);
|
||||||
}
|
}
|
||||||
else if (PySlice_Check(item)) {
|
else if (PySlice_Check(item)) {
|
||||||
PySliceObject *slice = (PySliceObject *)item;
|
PySliceObject *slice = (PySliceObject *)item;
|
||||||
@ -4948,7 +4948,7 @@ Pointer_subscript(PyObject *_self, PyObject *item)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (cur = start, i = 0; i < len; cur += step, i++) {
|
for (cur = start, i = 0; i < len; cur += step, i++) {
|
||||||
PyObject *v = Pointer_item(_self, cur);
|
PyObject *v = Pointer_item(myself, cur);
|
||||||
PyList_SET_ITEM(np, i, v);
|
PyList_SET_ITEM(np, i, v);
|
||||||
}
|
}
|
||||||
return np;
|
return np;
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CThunkObject_dealloc(PyObject *_self)
|
CThunkObject_dealloc(PyObject *myself)
|
||||||
{
|
{
|
||||||
CThunkObject *self = (CThunkObject *)_self;
|
CThunkObject *self = (CThunkObject *)myself;
|
||||||
PyObject_GC_UnTrack(self);
|
PyObject_GC_UnTrack(self);
|
||||||
Py_XDECREF(self->converters);
|
Py_XDECREF(self->converters);
|
||||||
Py_XDECREF(self->callable);
|
Py_XDECREF(self->callable);
|
||||||
@ -23,9 +23,9 @@ CThunkObject_dealloc(PyObject *_self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
CThunkObject_traverse(PyObject *_self, visitproc visit, void *arg)
|
CThunkObject_traverse(PyObject *myself, visitproc visit, void *arg)
|
||||||
{
|
{
|
||||||
CThunkObject *self = (CThunkObject *)_self;
|
CThunkObject *self = (CThunkObject *)myself;
|
||||||
Py_VISIT(self->converters);
|
Py_VISIT(self->converters);
|
||||||
Py_VISIT(self->callable);
|
Py_VISIT(self->callable);
|
||||||
Py_VISIT(self->restype);
|
Py_VISIT(self->restype);
|
||||||
@ -33,9 +33,9 @@ CThunkObject_traverse(PyObject *_self, visitproc visit, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
CThunkObject_clear(PyObject *_self)
|
CThunkObject_clear(PyObject *myself)
|
||||||
{
|
{
|
||||||
CThunkObject *self = (CThunkObject *)_self;
|
CThunkObject *self = (CThunkObject *)myself;
|
||||||
Py_CLEAR(self->converters);
|
Py_CLEAR(self->converters);
|
||||||
Py_CLEAR(self->callable);
|
Py_CLEAR(self->callable);
|
||||||
Py_CLEAR(self->restype);
|
Py_CLEAR(self->restype);
|
||||||
|
@ -816,9 +816,9 @@ element_deepcopy(ElementObject* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
element_sizeof(PyObject* _self, PyObject* args)
|
element_sizeof(PyObject* myself, PyObject* args)
|
||||||
{
|
{
|
||||||
ElementObject *self = (ElementObject*)_self;
|
ElementObject *self = (ElementObject*)myself;
|
||||||
Py_ssize_t result = sizeof(ElementObject);
|
Py_ssize_t result = sizeof(ElementObject);
|
||||||
if (self->extra) {
|
if (self->extra) {
|
||||||
result += sizeof(ElementObjectExtra);
|
result += sizeof(ElementObjectExtra);
|
||||||
|
@ -293,12 +293,12 @@ check_decoded(PyObject *decoded)
|
|||||||
#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF)
|
#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF)
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
_PyIncrementalNewlineDecoder_decode(PyObject *_self,
|
_PyIncrementalNewlineDecoder_decode(PyObject *myself,
|
||||||
PyObject *input, int final)
|
PyObject *input, int final)
|
||||||
{
|
{
|
||||||
PyObject *output;
|
PyObject *output;
|
||||||
Py_ssize_t output_len;
|
Py_ssize_t output_len;
|
||||||
nldecoder_object *self = (nldecoder_object *) _self;
|
nldecoder_object *self = (nldecoder_object *) myself;
|
||||||
|
|
||||||
if (self->decoder == NULL) {
|
if (self->decoder == NULL) {
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user