Implementing validated widgets in our GUI
Now that you know how to validate your widgets, you have your work cut out for you! We have 17 input widgets, and you'll have to write validation code like that shown in the previous section for all of them to get the behavior we need. Along the way, you'll need to make sure the widgets respond consistently to errors and present a consistent API to the application.
If that sounds like something you'd like to put off indefinitely, I can't blame you. Maybe there's a way we can cut down the amount of repetitive code we need to write.
Introducing the power of multiple inheritance
So far, we have learned that Python allows us to create new classes by subclassing, inheriting features from the superclass, and only adding or changing what's different about our new class. Python also supports building classes using multiple inheritance, in which a subclass can inherit from multiple superclasses. We can exploit...