"vlad_fig" <vlad_...@yahoo.com> wrote: > file.writeStuff(2,a1,a2) > file.writeStuff(3,a1,a2,a3) > .... > file.writeStuff(n,a1,a2,...an) > --- > so i want a method i can call based on the number of parameters > n , and that allows me to add these extra parameters based on n
It's not necessary to have to specify the number of parameters, you can use Python's support for optional parameters[1] instead: def writeStuff(self, *args): self.someLines.append(args) args will be a list of the values passed into writeStuff. 1: http://docs.python.org/reference/expressions.html#calls -- http://mail.python.org/mailman/listinfo/python-list