En Tue, 06 Feb 2007 20:35:43 -0300, <[EMAIL PROTECTED]> escribió: > Anyways heres my error: > ************************************************************************************************************************ > ***File "C:/Documents and Settings/Eric/Desktop/Python/2d guessing > game.py", line 11, in <module>*** > *** randp = Point(random.randint(1, 20), random.randint(1, > 20)) *** > ***TypeError: default __new__ takes no > parameters > ***
> class Point(object): > def _init_(self, x, y): > self.x = x > self.y = y > > #generate random coordinate point > randp = Point(random.randint(1, 20), random.randint(1, 20)) _init_ should be __init__ (two leading and trailing underscores) That special method is used to initialize your newly constructed Point instance. See section 9.3.2 on the Python tutorial: http://docs.python.org/tut/node11.html#SECTION0011320000000000000000 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list