Pickle Problem

7stud bbxx789_05ss at yahoo.com
Fri Mar 16 07:02:57 CET 2007

> I'm trying to make the transition from Java

> The biggest thing that was messing me up was the
> mandatory "self" input. For some reason I was thinking
> that, if I had parenthesis, I would have to define it.

I think things are pretty similar in Java.  Java does the same thing
except 'self' is invisible in Java, and in Java 'self' is called
'this'.  For instance, in Java you can write:

int num;

void setNum(int num)
      this->num = num

Where did 'this' come from?  In Java, methods are passed the invisible
'this' argument, which you can then access inside the method.  It
looks like Python just "uncloaks" Java's 'this'.

More information about the Python-list mailing list