Python dynamic attribute creation

Aahz aahz at pythoncraft.com
Mon Jun 28 03:16:50 EDT 2010


In article <vIaVn.238$vD2.10 at news-server.bigpond.net.au>,
Neil Hodgson  <nyamatongwe+thunder at gmail.com> wrote:
>WANG Cong:
>>
>> 4) Also, this will _somewhat_ violate the OOP princples, in OOP,
>> this is and should be implemented by inherence.
>
>   Most object oriented programming languages starting with Smalltalk
>have allowed adding attributes (addInstVarName) to classes at runtime.
>Low level OOPLs like C++ and Delphi did not implement this for
>efficiency reasons.

That reminds me of this quote:

"...some experts might say a C++ program is not object-oriented without
inheritance and virtual functions.  As one of the early Smalltalk
implementors myself, I can say they are full of themselves." --zconcept
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra



More information about the Python-list mailing list