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?



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

Reply via email to