[Tutor] simple arg problem
eryksun
eryksun at gmail.com
Sat Jan 4 04:14:57 CET 2014
On Fri, Jan 3, 2014 at 9:56 PM, Keith Winston <keithwins at gmail.com> wrote:
>
> if __name__ == "__main__":
> tarray = CandL_Array
> tarray.populate(100)
>
> I get an error
>
> Traceback (most recent call last):
> File "/home/keithwins/Dropbox/Python/CandL8.py", line 127, in <module>
> tarray.populate(100)
> TypeError: populate() missing 1 required positional argument: 'gamecount1'
>>>>
>
> Which seems to say it wants another argument, but I am in the habit of not
> counting the self argument... I thought I understood that. I'm sure it's
> something obvious, but I've been staring at it for hours. This is going to
> be embarrassing...
You've assigned the class to `tarray` instead of assigning an instance
of the class. Forgetting to call() is a common mistake.
More information about the Tutor
mailing list