I have a bunch of functions that do various utility-type tasks in an 
application (such as prettifying date strings, etc.), and they are used in many 
modules.  Much of the time, I have just been lazily copying and pasting the 
functions into whichever modules need them.  I realize that is very bad form 
and I should refactor, and so I am beginning to put these functions in their 
own module so that I can import the module and its functions when I need it; 
they will all be in one place and only only place.

My question is about resources.  Let's say I have the module, myUtils.py, and I 
import it into every other module that will need one or more of the functions 
within it.  Is this in any way costly in terms of memory?  (since each time I 
import myUtils.py I import *all* the functions, instead of in the cut&paste 
approach, where I just run the functions I need).

I'm fairly sure this is not at all an issue, but I just want to understand why 
it's not.  

Thanks.



                                          
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to