On Wed, 01 Mar 2006 11:32:02 -0800, Derek Basch wrote:

> This one has always bugged me. Is it better to just slap a "self" in
> front of any variable that will be used by more than one class method
> or should I pass around variable between the methods?

That depends on whether the variable is conceptually an attribute of the
instance or a parameter.

Attributes of the instance should be made instance attributes by (as you
put it) slapping a "self" in front of it. Parameters of the methods should
be passed around as arguments to the methods.


-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to