Different values for property vs attribute???

Shalabh Chaturvedi shalabh at cafepy.com
Tue May 4 23:35:54 EDT 2004


j_mckitrick wrote:
> I forgot to mention, I have another class like this:
> 
>     def getauditcheckpass(self):
>         return self.state[AUDITCHK] == PASS
>         
>     # properties
>     auditcheckpass = property(getauditcheckpass)
> 
> 
> and it seemed to work ok.

 From http://www.python.org/2.2.3/descrintro.html#property :

Properties do not work for classic classes, but you don't get a clear 
error when you try this. Your get method will be called, so it appears 
to work, but upon attribute assignment, a classic class instance will 
simply set the value in its __dict__ without calling the property's set 
method...

--
Shalabh





More information about the Python-list mailing list