We use pyre for linting and have been updating some old polymorphic code to be typed. The __init__ method has quite a few arguments and was using **kwargs to pass them through the various layers with each layer adding a few more. To make them strongly typed we ended up just replicating the arguments everywhere. But if we add a new arg to the base class we have to remember to put it everywhere else. So my initial thought was that maybe there was a way to create a type assertion between the classes that the method args are supersets of their base classes. I'm my research I was also seeing some discussions around using typed dicts to define the arguments for each layer and merge them. But my python-foo is not strong and the examples seemed incomplete so I didn't even attempt that option. How can I enforce the init arguments are a superset of the base class? Continue reading...