Py3: replace sq_slice and sq_ass_slice with mp_subscript and mp_ass_subscript because they are not used any more in Py3
This commit is contained in:
@@ -66,6 +66,7 @@ public:
|
||||
-
|
||||
+ if (self.export.Sequence):
|
||||
static PySequenceMethods Sequence[];
|
||||
static PyMappingMethods Mapping[];
|
||||
-
|
||||
+ if (self.export.RichCompare):
|
||||
static PyObject * richCompare(PyObject *v, PyObject *w, int op);
|
||||
@@ -180,14 +181,14 @@ public:
|
||||
+ if (self.export.Sequence.sq_item):
|
||||
static PyObject * sequence_item(PyObject *, Py_ssize_t);
|
||||
-
|
||||
+ if (self.export.Sequence.sq_slice):
|
||||
static PyObject * sequence_slice(PyObject *, Py_ssize_t, Py_ssize_t);
|
||||
+ if (self.export.Sequence.mp_subscript):
|
||||
static PyObject * mapping_subscript(PyObject *, PyObject *);
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_item):
|
||||
static int sequence_ass_item(PyObject *, Py_ssize_t, PyObject *);
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_slice):
|
||||
static int sequence_ass_slice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
|
||||
+ if (self.export.Sequence.mp_ass_subscript):
|
||||
static int mapping_ass_subscript(PyObject *, PyObject *, PyObject *);
|
||||
-
|
||||
+ if (self.export.Sequence.sq_contains):
|
||||
static int sequence_contains(PyObject *, PyObject *);
|
||||
@@ -286,10 +287,11 @@ PyTypeObject @self.export.Name@::Type = {
|
||||
-
|
||||
+ if (self.export.Sequence):
|
||||
@self.export.Namespace@::@self.export.Name@::Sequence, /*tp_as_sequence*/
|
||||
@self.export.Namespace@::@self.export.Name@::Mapping, /*tp_as_mapping*/
|
||||
= else:
|
||||
0, /*tp_as_sequence*/
|
||||
-
|
||||
0, /*tp_as_mapping*/
|
||||
-
|
||||
0, /*tp_hash*/
|
||||
0, /*tp_call */
|
||||
0, /*tp_str */
|
||||
@@ -445,21 +447,13 @@ PySequenceMethods VectorPy::Sequence[] = { {
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.sq_slice):
|
||||
sequence_slice,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_item):
|
||||
sequence_ass_item,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_slice):
|
||||
sequence_ass_slice,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.sq_contains):
|
||||
sequence_contains,
|
||||
= else:
|
||||
@@ -476,6 +470,24 @@ PySequenceMethods VectorPy::Sequence[] = { {
|
||||
0
|
||||
-
|
||||
} };
|
||||
|
||||
PyMappingMethods VectorPy::Mapping[] = { {
|
||||
+ if (self.export.Sequence.sq_length):
|
||||
sequence_length,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.mp_subscript):
|
||||
mapping_subscript,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
+ if (self.export.Sequence.mp_ass_subscript):
|
||||
mapping_ass_subscript,
|
||||
= else:
|
||||
0,
|
||||
-
|
||||
} };
|
||||
-
|
||||
|
||||
/// Attribute structure of @self.export.Name@
|
||||
@@ -1073,9 +1085,9 @@ PyObject * @self.export.Name@::sequence_item(PyObject *, Py_ssize_t)
|
||||
return 0;
|
||||
}
|
||||
-
|
||||
+ if (self.export.Sequence.sq_slice):
|
||||
+ if (self.export.Sequence.mp_subscript):
|
||||
|
||||
PyObject * @self.export.Name@::sequence_slice(PyObject *, Py_ssize_t, Py_ssize_t)
|
||||
PyObject * @self.export.Name@::mapping_subscript(PyObject *, PyObject *)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
|
||||
return 0;
|
||||
@@ -1089,9 +1101,9 @@ int @self.export.Name@::sequence_ass_item(PyObject *, Py_ssize_t, PyObject *)
|
||||
return -1;
|
||||
}
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_slice):
|
||||
+ if (self.export.Sequence.mp_ass_subscript):
|
||||
|
||||
int @self.export.Name@::sequence_ass_slice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *)
|
||||
int @self.export.Name@::mapping_ass_subscript(PyObject *, PyObject *, PyObject *)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
|
||||
return -1;
|
||||
@@ -1391,9 +1403,9 @@ PyObject * @self.export.Name@::sequence_item(PyObject *, Py_ssize_t)
|
||||
return 0;
|
||||
}
|
||||
-
|
||||
+ if (self.export.Sequence.sq_slice):
|
||||
+ if (self.export.Sequence.mp_subscript):
|
||||
|
||||
PyObject * @self.export.Name@::sequence_slice(PyObject *, Py_ssize_t, Py_ssize_t)
|
||||
PyObject * @self.export.Name@::mapping_subscript(PyObject *, PyObject *)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
|
||||
return 0;
|
||||
@@ -1407,9 +1419,9 @@ int @self.export.Name@::sequence_ass_item(PyObject *, Py_ssize_t, PyObject *)
|
||||
return -1;
|
||||
}
|
||||
-
|
||||
+ if (self.export.Sequence.sq_ass_slice):
|
||||
+ if (self.export.Sequence.mp_ass_subscript):
|
||||
|
||||
int @self.export.Name@::sequence_ass_slice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *)
|
||||
int @self.export.Name@::mapping_ass_subscript(PyObject *, PyObject *, PyObject *)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user