[Zope] Re: [Zope-CMF] Persistent dictionaries

Thomas Olsen tol@tanghus.dk
Tue, 28 Aug 2001 19:51:11 +0200


On Sunday 26 August 2001 00:09, Dieter Maurer wrote:
> Thomas Olsen writes:
>  > Say you have an instance of a class MyClass with attributes myattr1 and
>  > myattr2; then you change the class definition for MyClass adding
>  > myattr3. 
>   2. Python calls "__getattr__" only the normal lookup was
>      not successful. The normal lookup will find
>      the class attribute "myattr3", "__getattr__" would
>      not be called.

But if the object was instantiated before adding myattr3 to the class 
definition the objects __dict__ wouldn't contain it and you would get an 
AttributeError when trying to access it if you didn't implement __getattr__?

-- 
Regards,
	Thomas Olsen

http://www.tanghus.dk