[Tutor] A question about the self and other stuff

Luke Paireepinart rabidpoobear at gmail.com
Mon Oct 26 04:12:46 CET 2009


On Sun, Oct 25, 2009 at 10:10 PM, Luke Paireepinart
<rabidpoobear at gmail.com>wrote:

>
>
>> 2- in the final few lines where I assign an object to the class, I notice
>> that a parameter was entered in the class name, "Robot(D23)", although when
>> defining the class I didn't put any arguments for it.
>>
> Yes you did,
> __init__ takes 2 parameters, "self" and "name".  When constructing a new
> object via Robot(D23) you are implicitly passing "self" and you are
> explicitly passing 'D23' as "self".
>

Correction,
 When constructing a new object via Robot(*'D23'*) you are implicitly
passing "self" and you are explicitly passing 'D23' as "*name*".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091025/15af0333/attachment-0001.htm>


More information about the Tutor mailing list