[Tutor] Question About Function Arguments and Returned Results

Richard Querin rfquerin at gmail.com
Wed Apr 12 03:47:05 CEST 2006


I'm a relative newbie writing a function that carries out a bunch of
calculations. The function requires about 4 or 5 numeric arguments as input
but the data returned from the function call is about a dozen numbers in
addition to a list of strings and a fairly long list of numbers (200+).  My
question is whether to create an class object beforehand and pass this into
and out of the function, or to just keep things simple and pass in the 4
arguments and return a simple list object containing the numbers and lists
of strings and numbers.

Is there any benefit to using an class object for this? I don't want to
limit what I can do with the returned data later. I want to be able to
display the results of this function in different ways later on. I'm going
to have a lot of functions of this type and I know I will have to keep the
format of the results list object well documented in order to keep track of
what is returned when I look at the code 6 months from now. Is a simple list
the best way? or a class object?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060411/5a70883f/attachment.htm 


More information about the Tutor mailing list