Pierre Quentel wrote:

> In func1, _var1 = 1 creates a local variable _var1 (local to the
> method), not an attribute of the instance. If you want an instance
> attribute you must specify the reference to the instance by
> self._var1 = 1 ; self must be passed as an attribute to func1
> 
>     def func1(self):
>         self._var1 = 1

Note this only changes the attribute in the instance.  If he wants it to 
be changed for all other instances, he needs to change it in the class 
with:: A._var1 = 1

-- 
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Every path has its puddle.
    -- (an English proverb)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to