Python dynamic attribute creation

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Jun 27 06:47:22 EDT 2010


WANG Cong a écrit :
> On 06/25/10 17:25, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> 
>> On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote:
>>
(snip)
>>> 4) Also, this will _somewhat_ violate the OOP princples, in OOP, this is
>>> and should be implemented by inherence.
>> Perhaps, and perhaps not. But Python has never pretended to slavishly 
>> follow OOP "principles". Python does what works, not necessarily what is 
>> a "pure" design. Python has functional programming, procedural 
>> programming, and OO programming, and happily mixes them all together.
>>
> 
> "Happily mixes them all together" doesn't mean it is elegant. :)

Python has no pretention at "elegance". It's a _very_ practical
language. It's designed to help you get the job done, period.



More information about the Python-list mailing list