[Python-Dev] C-level duck typing (original) (raw)

martin at v.loewis.de martin at v.loewis.de
Thu May 17 10:27:32 CEST 2012


So maybe it's worth thinking about making a general mechanism available for third parties to extend the type object without them all needing to have their own tpflags bits and without needing to collude with each other to avoid conflicts.

That mechanism is already available. Subclass PyTypeType, and add whatever fields you want.

Regards, Martin



More information about the Python-Dev mailing list