3 ms·
Both useful, yes. But consider this: my_instance = SomeClass(args) my_instance.method() vs my_dict = some_mod.thing_new(args) some_mod.function(my_
by wheelerof4te 5y ago
Both useful, yes. But consider this:
my_instance = SomeClass(args)
my_instance.method()
vs
my_dict = some_mod.thing_new(args)
some_mod.function(my_dict, args)
These are semantically the same things. If you don't believe me, consider this is the same as above class example:
SomeClass.method(my_instance)
As for the inheritance, you could theoretically insert the "parent" dictionary inside the "child" dictionary and just create a new module for child "methods". But that would be too convoluted and surely unpythonic.
My argument goes against OOP, so I would just ignore inheritance.