<div>Okay I copied this code directly from a book (author Michael Dawson) and it's not working. I'm sure I've missed something obvious like the spacing or something but I've been staring at it for 10 minutes and I can't see it. I'll put the code and error message below. Can someone else spot the problem?</div> <div> </div> <div>class Critter(object):<BR> """A virtual pet"""<BR> def ___init___(self, name):<BR> print "A new critter has been born!"<BR> self.name = name</div> <div><BR> def __str__(self):<BR> rep = "Critter object\n"<BR> rep += "name: " + self.name + "\n"<BR> return rep</div> <div><BR> def talk(self):<BR> print "Hi,
I'm", self.name, "\n"</div> <div>#main<BR>crit1 = Critter("Poochie")<BR>crit1.talk()</div> <div> </div> <div>Here's the error message:</div> <div> </div> <div>Traceback (most recent call last):<BR> File "C:/Python25/attributecrit.py", line 15, in <module><BR> crit1 = Critter("Poochie")<BR>TypeError: default __new__ takes no parameters</div> <div> </div><p> 
<hr size=1>Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping">
Find them fast with Yahoo! Search.</a>