From: "M.-A. Lemburg" firstname.lastname@example.org
"Martin v. Loewis" wrote:
Indeed -- and I have a question there: why did you have to implement this as meta-type ?
MAL, please do read the patch discussion first, at
The discussion on SF doesn't really answer my question. What Nick did is fascinating: he reused the type object implementation to mimic a sequence ! That's cool, but looks like an awfully tricky way of doing something straight forward such as sub-classing the tuple type to extend it with an additional dictionary. So the question remains: why did Nick *have* to implement this as meta-type ?
As I understand it, PyStructSequence_InitType() is a factory for types aka metaclasses. The above statment 'he reused the type object to mimic a sequence' is IMO wrong.
*My* question would be (maybe this is what MAL meant): why aren't the created types subclasses of PyTupleType?