I'd like to be able to declare the message variable to make it readable.

One other question; when declaring class methods, do I always have to make the first parameter "self"? And why is it Python does this in the first place? Seems a little odd compared to methods in Java or PHP for example.

Or you can just use self.message like you showed and the instance variable will spring into existence.

To define private variables, add 2 leading underscores (e.g. __myvar) and Python will mangle it into _classname__myvar. Data hiding in this case is not strictly enforced as in Java (since you can access it using '_classname__myvar' - it's more of a 'contractual agreement' basis)

>> when declaring class methods, do I always have to make the first parameter "self"? And why is it Python does this in the first place?

Consider an object x of class Test (which you defined above). Typically, from outside the class, you'd call the get() method of x like so:

Code:

msg = x.get();

What Python does is translate it into

Code:

msg = Test.get(x);

Why the parameter is called 'self' is a matter of convention (meaning you can use something like 'pinkgoblin' instead of 'self', but it's good to follow the convention to prevent confusing others)