[Python-Dev] What's a PyStructSequence ?

Martin v. Loewis martin@v.loewis.de
Thu, 29 Nov 2001 23:22:15 +0100


> *My* question would be (maybe this is what MAL meant):
> why aren't the created types subclasses of PyTupleType?

How would you inherit from PyTupleType in C? E.g. by doing

struct PyStatType{
  PyTupleType foo;
  PyObject *additional_field;
};

That reads well, but it is wrong: PyTupleType ends in a flexible array
member, so it cannot be used as the member of another struct.

Regards,
Martin