[Tutor] Question About Function Arguments and Returned Results

Richard Querin rfquerin at gmail.com
Wed Apr 12 04:27:26 CEST 2006


On 4/11/06, Kent Johnson <kent37 at tds.net> 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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060411/349c4c84/attachment.htm 


More information about the Tutor mailing list