[Tutor] Why are arguments sometimes on the left side?
mnshtb at gmail.com
Mon Sep 20 17:04:49 CEST 2010
Okay, we now have a dog named Fluffy, which is just one instance of
> our dog class. With the way you would want to do things, I would have
> to say
> But what is bark? Where is it defined? You can see it is in the dog
> class, but Python cannot; you passed a dog instance to bark(), but
> that will not tell Python to search in the dog class to find the bark
> method. Saying
> will work since it tells Python:
> take this instance of dog, called f, and call its bark method. The
> bark method is in the dog class since bark is being called on a dog
> object (remember that an object is just an instance of a class).
> I hope this made some sense. <http://www.facebook.com/mehgcap>
This is terrific --- very clarifying. Thank you so much.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor