block dynamic attribute creation

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Feb 19 12:52:13 EST 2009


En Thu, 19 Feb 2009 13:20:25 -0200, Alan G Isaac <alan.isaac at gmail.com>  
escribió:

>>>        if hasattr(self, attr): #update val
>>>          self.__dict__[attr] = val

> On 2/19/2009 3:54 AM Gabriel Genellina apparently wrote:
>> In particular, your code prevents using class attributes as a default
>> value for instance attributes
>
> Doesn't the above allow that?

Sorry, yes, sure!


-- 
Gabriel Genellina




More information about the Python-list mailing list