Open jeffiuliano opened 1 year ago
I'm not sure I'm sold on making the class callable. For ComponentType
it currently seem benign, but presumably we'd want to make other classes callable too, and for some other classes it would be problematic. E.g., if Component
were callable, it would probably break things if you started doing operations on the object before it had actually been added to the DB.
I'm not necessarily opposed to the subs
property, but is it mainly to make the call less verbose? I'd certainly be in favour of shortening some of the method names which are too long. I.e., would you be OK with shortening the method to subcomponents()
or subcomps()
or similar? Or is there a need to additionally have a property?
(Also, sorry for taking so long to finally comment …)
One typo fix, two suggestions.
subs
property of a component so you can, instead of egswitch1.get_all_subcomponents()
writeComponentType
instances callable (by adding__call__
fn to the class definition). This allows:instead of