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

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -