sequence
mutable sequences:
immutable sequences:
int
PySequence_Check(PyObject *s)
{
if (PyDict_Check(s))
return 0;
return Py_TYPE(s)->tp_as_sequence &&
Py_TYPE(s)->tp_as_sequence->sq_item != NULL;
}
We can see that if it is not a dict and if it has a method __getitem__
, then it returns 1.