On 4/11/06, Kent Johnson <[EMAIL PROTECTED]> wrote:

There is no need to pass the class object in to the function, you can
create it in the function and return it. A class might be nice because
it gives names to the various values. A dict can also be used for this.
Do what feels right :-)

To be more specific, I'm going to have probably 6 functions that do similar things. They all take slightly different arguments, they all do slightly different calculations, but the results of all the functions are the same format. So I guess it makes sense to use a class. Now, when you say 'create it in the function', you mean create the class instance inside the function and return that instance? The class itself is defined somewhere else in the module containing the functions so that all the functions have access to it. (Total newb to python and classes so sorry if that's a stupid question).


 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to