Python 3K or Python 2.9?

Peter Decker pydecker at gmail.com
Wed Sep 12 21:42:06 EDT 2007


On 9/12/07, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
> TheFlyingDutchman <zzbbaadd at aol.com> writes:
>
> > I am talking about how an author describes in English the "this"
> > pointer/reference in their book on programming C++ or Java.
> >
> > I don't think you will find them saying that under the covers "this"
> > was passed to the method (if in fact it is). They just say that it
> > refers to the current object inside that object's method.
>
> In other words, it's magic, and the behaviour has to be explained so
> the reader knows where the undeclared 'this' comes from.
>
> How is that preferable to the magic of "instance is passed as the
> first argument to a method"?

So everything that isn't passed explicitly is "magic"? I suppose
__builtin__ counts as magic, too?

Define 'self' as a keyword, and its usage becomes no more magical than
'def' or 'break'.

-- 

# p.d.



More information about the Python-list mailing list