Commit 0809576c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Move these PySequence_* methods into abstract.cpp

parent 7f876c25
......@@ -1416,6 +1416,77 @@ Fail:
return NULL;
}
extern "C" PyObject* PySequence_Repeat(PyObject* o, Py_ssize_t count) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_InPlaceConcat(PyObject* o1, PyObject* o2) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_InPlaceRepeat(PyObject* o, Py_ssize_t count) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_GetItem(PyObject* o, Py_ssize_t i) noexcept {
try {
// Not sure if this is really the same:
return getitem(o, boxInt(i));
} catch (ExcInfo e) {
setCAPIException(e);
return NULL;
}
}
extern "C" PyObject* PySequence_GetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2) noexcept {
try {
// Not sure if this is really the same:
return getitem(o, createSlice(boxInt(i1), boxInt(i2), None));
} catch (ExcInfo e) {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
}
extern "C" int PySequence_SetItem(PyObject* o, Py_ssize_t i, PyObject* v) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" int PySequence_DelItem(PyObject* o, Py_ssize_t i) noexcept {
try {
// Not sure if this is really the same:
delitem(o, boxInt(i));
return 0;
} catch (ExcInfo e) {
setCAPIException(e);
return -1;
}
}
extern "C" int PySequence_SetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2, PyObject* v) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" int PySequence_DelSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" Py_ssize_t PySequence_Count(PyObject* o, PyObject* value) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" Py_ssize_t PySequence_Index(PyObject* o, PyObject* value) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" PyObject* PyObject_CallFunction(PyObject* callable, const char* format, ...) noexcept {
va_list va;
PyObject* args;
......
......@@ -634,77 +634,6 @@ extern "C" int PyObject_Print(PyObject* obj, FILE* fp, int flags) noexcept {
return internal_print(obj, fp, flags, 0);
};
extern "C" PyObject* PySequence_Repeat(PyObject* o, Py_ssize_t count) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_InPlaceConcat(PyObject* o1, PyObject* o2) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_InPlaceRepeat(PyObject* o, Py_ssize_t count) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
extern "C" PyObject* PySequence_GetItem(PyObject* o, Py_ssize_t i) noexcept {
try {
// Not sure if this is really the same:
return getitem(o, boxInt(i));
} catch (ExcInfo e) {
setCAPIException(e);
return NULL;
}
}
extern "C" PyObject* PySequence_GetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2) noexcept {
try {
// Not sure if this is really the same:
return getitem(o, createSlice(boxInt(i1), boxInt(i2), None));
} catch (ExcInfo e) {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return nullptr;
}
}
extern "C" int PySequence_SetItem(PyObject* o, Py_ssize_t i, PyObject* v) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" int PySequence_DelItem(PyObject* o, Py_ssize_t i) noexcept {
try {
// Not sure if this is really the same:
delitem(o, boxInt(i));
return 0;
} catch (ExcInfo e) {
setCAPIException(e);
return -1;
}
}
extern "C" int PySequence_SetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2, PyObject* v) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" int PySequence_DelSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" Py_ssize_t PySequence_Count(PyObject* o, PyObject* value) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" Py_ssize_t PySequence_Index(PyObject* o, PyObject* value) noexcept {
fatalOrError(PyExc_NotImplementedError, "unimplemented");
return -1;
}
extern "C" PyObject* PyIter_Next(PyObject* iter) noexcept {
try {
Box* hasnext = iter->hasnextOrNullIC();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment