[Tutor] Bound To Be A Typo
Joshua Simpson
std3rr at gmail.com
Mon Dec 17 21:19:41 CET 2007
On Dec 17, 2007 12:16 PM, earlylight publishing <
earlylightpublishing at yahoo.com> wrote:
>
> class Critter(object):
> """A virtual pet"""
> def ___init___(self, name):
> print "A new critter has been born!"
>
>
You're using 3 underscores before and after 'init'. The constructor for
Python classes is '__init__' not '___init___'
--
-
http://stderr.ws/
"Insert pseudo-insightful quote here." - Some Guy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071217/a197fe68/attachment.htm
More information about the Tutor
mailing list