[EMAIL PROTECTED] wrote: > I've got: > > class MultipleRegression: > def __init__(self, dbh, regressors, fund): > self.dbh = dbh > self.regressors = regressors > > and I want to be able to enter regressors as a list like > MultipleRegression(dbh, [1,2,3,4], 5). But when I do this only the 1 > gets passed to regressors and thus to self.regressors.
Your problem lies elsewhere, as when I do exactly that, I get the correct results: >>> mr = MultipleRegression(10, [1,2,3,4], 5) >>> print mr.regressors [1, 2, 3, 4] So I think the way you are passing your list to MultipleRegression is perhaps wrong. I expect your problem is in creating that list in the first place from an unknown number of items. Basically you need to create the list, repeatedly add the necessary items to it until you're done, and then pass that to MultipleRegression. How to create and populate that list will depend on where you're getting the data from. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list