[Baypiggies] Python3 Metaclass, inheritance and MRO question

Aseem Mohanty ams.fwd at gmail.com
Thu Dec 27 21:56:14 EST 2018


Code: https://pastebin.com/0QfbPy5W
python 3.5

What I am trying to do is allow declarative instance creation for some
classes.

I have a metaclass that creates and initializes a target class declared
declaratively. The target may or may not have other bases. I am dynamically
setting up a base class for the target so that the declarative bit will
work. I am also wrapping the __init__ for the target with a super call so
that some necessary initialization in the base will happen.

In the code you will see I have two other parent classes for the target
that all have similar sigs and my understanding was that a super call would
call all inits as long as they are co-operative .
However that does not seem to happen. The MRO is setup appropriately but
never bubbles up past the first init.

Any help would be greatly appreciated.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20181227/60470031/attachment.html>


More information about the Baypiggies mailing list