Python OOP: inefficient to put methods in classes? -
i use classes how 1 might use namedtuple
(except of course attributes mutable). moreover, try put lengthy functions in classes won't instantiated frequently, conserve memory.
from memory point of view, inefficient put functions in classes, if expected class instantiated often? keeping aside it's design compartmentalize functionality, should worried about?
methods don't add weight instance of class. method exists once , parameterized in terms of object on operates. that's why have self
parameter.
Comments
Post a Comment