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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -