What I’m trying to do:
I am trying to have an inheritance-basted structure to organise the different kind of components I can draw on my page
What I’ve tried and what’s not working:
I have created a new module, and put a class abstractGague(): in it which implemented some shared functionality. I then went to one of the forms I want to inherit from this class, and changed class thermometerGague(thermometerGagueTemplate): to class thermometerGague(thermometerGagueTemplate, abstractGague):
This has resulted in be getting an error of TypeError: bases must be 'type' objects
I have no idea what exactly is a base here or how do I make it a ‘type’ object
I think @stefano.menci answered the main problem, but just to add on the additional, end question.
The base would be the parent class. A class is an instance of a type. Given that, bases must be 'type' objects can be interpreted as The parent must be a 'class' object, but the original error message is more precise.
Upd: Okay I found my problem. Because I made a module called abstractGague, with a class abstractGague in it, and then imported the module, I needed to declare thermometerGague with abstractGague.abstractGague, not abstractGague, because the latter is a package name
I read that, too. But I’ve seen so many examples of modules being named after the classes they define, I mistook common practice for “good practice.” Thank you for straightening me out!