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):
>     return self._site_id
>
> def SetSiteID(self, value):
>     if not (hasattr(self, '_site_id') and self._site_id): self._site_id = 
> value
>
> site_id = property(GetSiteID, SetSiteID)
>
> site_id is supposed to be set either through a parameter, derived from the 
> server name (the default case) or via a class attribute:
>
> class SiteList(Lists):
>     site_id = 1
>
> The latter case does not work: the site_id is still derived from the server 
> name for objects of class SiteList. Why is that? How can I make Python check 
> the superclasses for a class attribute before applying the SiteMode() method?
>
> Thanks,
>
> Jan
> --
> How many Microsoft engineers does it take to screw in a lightbulb? None. They 
> just redefine "dark" as the new standard.
> _______________________________________________
> Tutor maillist  -  [email protected]
> http://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to