May-02-2023, 09:09 PM
(This post was last modified: May-02-2023, 09:09 PM by billykid999.)
(May-02-2023, 11:51 AM)Gribouillis Wrote:(May-02-2023, 11:24 AM)billykid999 Wrote: as this one will force me to do multiple inheritanceI don't see how it would force you to do multiple inheritance. Nobody is ever forced to do that.
I may be inheriting from my individual classes in the furture, which is why I wrote them in classes to begin with - that and the code looks cleaner, and it's easier to track which functions belong to which class if I add more functions inside each class, which may be a need if i decide to try to automate cloud devices and I need different functions to handle it. The multiple inheritance will be useful at that point if i inherit from two different classes to use to functions/commands. It isn't forced by declaring inf_dict as an attribute, I mis-spoke. When i declare info_dict right under the class and not as an attribute instance it makes the code look a little uglier, but it also takes away from that I may not even need classes at that point ~ declaring them as instance attributes gives me a reason for making it a class other than the notes mentioned above. However I recognized i was calling each classes functions (i.e HardwareMaintenance) without instantiating the class in a main calling class. i'd have to refactor the code for, from what I'm seeing little to no improvement int performance. By the way the tips helped me a lot, I was going nuts trying to see where I was going wrong, because if I may decide to add attributes to the classes and inherit from multiple classes for ad-hoc issues, which was my original intent of making info_dict as an instance (__init__) attribute.