diff --git a/src/types/color_sequence/type.c b/src/types/color_sequence/type.c index 15dce5f..8446ede 100644 --- a/src/types/color_sequence/type.c +++ b/src/types/color_sequence/type.c @@ -169,7 +169,7 @@ static PyObject* interpolate( static Py_ssize_t mp_length(PyObject* self_in) { ColorSequenceObject* self = (ColorSequenceObject*)self_in; - return PyLong_FromLong(self->_sequence.length); + return self->_sequence.length; } static PyObject* mp_subscript(PyObject* self_in, PyObject* key) { diff --git a/src/types/scalar_field/type.c b/src/types/scalar_field/type.c index bf611bc..b42ad0b 100644 --- a/src/types/scalar_field/type.c +++ b/src/types/scalar_field/type.c @@ -59,7 +59,7 @@ static int allocate_scalars(ScalarFieldObject* self, size_t len) { static Py_ssize_t mp_length(PyObject* self_in) { ScalarFieldObject* self = (ScalarFieldObject*)self_in; - return PyLong_FromLong(self->length); + return self->length; } static PyObject* mp_subscript(PyObject* self_in, PyObject* key) {