Re: [Tutor] class attributes

2005-11-16 Thread Eric Walker
> Are they class attributes - shared by all instances of the class or are > they instance attributes - unique values in each instance? all instances of the class share these attributes. > So you have a list of all the instances of the class and modifying values. > Since you do it on a per insta

Re: [Tutor] class attributes

2005-11-16 Thread Alan Gauld
> I have a class with attributes Are they class attributes - shared by all instances of the class or are they instance attributes - unique values in each instance? > I am now going back through my object list of that > class So you have a list of all the instances of the class and modifying val

Re: [Tutor] class attributes

2005-11-16 Thread Kent Johnson
Eric Walker wrote: > ahh, you just blew smoke in my face. :) > > I have a class with attributes. These attributes eventually have the value of > some lines in a file. I am now going back through my object list of that > class and assigning values to the attributes depending on another variable

Re: [Tutor] class attributes

2005-11-16 Thread Eric Walker
ahh, you just blew smoke in my face. :) I have a class with attributes. These attributes eventually have the value of some lines in a file. I am now going back through my object list of that class and assigning values to the attributes depending on another variable that will change and be the s

Re: [Tutor] class attributes

2005-11-16 Thread Alan Gauld
> markersExp = ['big','boss','two','three'] > for mark in markersExp: > print y.mark > > Now I have an list of class objects that are in an outerloop. y is how I > access it. The attributes names of the class objects match whats in > markersExp. Do you have to use string versions of the cl

Re: [Tutor] class attributes

2005-11-16 Thread Kent Johnson
Eric Walker wrote: > Hello, > If I have some like the following: > > markersExp = ['big','boss','two','three'] > for mark in markersExp: > print y.mark > > Now I have an list of class objects that are in an outerloop. y is how I > access it. The attributes names of the class objects match w

Re: [Tutor] Class attributes not overriding parameters

2005-11-06 Thread Andreas Kostyrka
Am Samstag, den 05.11.2005, 22:30 +0100 schrieb Jan Eden: > Hi, > > I use the following construction to make sure the data attribute site_id is > set only once for each object: > > def GetSiteID(self): > return self._site_id > > def SetSiteID(self, value): > if not (hasattr(self, '_site

Re: [Tutor] Class attributes not overriding parameters

2005-11-06 Thread Jan Eden
Hi Liam, Liam Clarke wrote on 06.11.2005: >Hi Jan, > >Won't this > >site_id = property(GetSiteID, SetSiteID) > >and this > >site_id = 1 > >collide? > Yup. After writing my message, I thought about it again: the property function gets never executed when I use the class attribute. So I changed

Re: [Tutor] Class attributes not overriding parameters

2005-11-05 Thread Liam Clarke
Hi Jan, Won't this site_id = property(GetSiteID, SetSiteID) and this site_id = 1 collide? On 11/6/05, Jan Eden <[EMAIL PROTECTED]> wrote: > Hi, > > I use the following construction to make sure the data attribute site_id is > set only once for each object: > > def GetSiteID(self): > retu