Am Sonntag, 12. März 2006 19:36 schrieb EP: > This is likely a stupid question, but I am confused about what is going > on with class attributes as far as whether they "stick". I ran across > this in a program I am writing, but have reproduced the behavoir below > - can someone point me in the right direction (thanks): > > class AttStickiness(object): > def __init__(self, myname="", mysex=""): > self.name=myname > self.sex=mysex
^--- sex > def changeSex(self, newsex=""): > self.mysex=newsex ^--- mysex You are not altering the same attribute. Cheers Christoph -- ~ ~ ".signature" [Modified] 1 line --100%-- 1,48 All -- http://mail.python.org/mailman/listinfo/python-list