Python dynamic attribute creation
Stephen Hansen
me+list/python at ixokai.io
Mon Jun 28 01:58:32 EDT 2010
On 6/27/10 10:10 PM, Carl Banks wrote:
> On Jun 27, 3:49 am, Bruno Desthuilliers
> <bdesth.quelquech... at free.quelquepart.fr> wrote:
>> WANG Cong a écrit :
>>
>>> On 06/26/10 00:11, Neil Hodgson<nyamatongwe+thun... 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.
>>
>>> Thanks, I have to admit that I know nothing about Smalltalk.
>>
>> Then you really don't know much about OO.
>
> I don't really know much about Smalltalk either.
Same. I've been informed that I find Objective-C rather "comfortable"
and strangely "Pythonic" because its object model is based in Smalltalk,
and although Python's a step or two farther removed (what with not
embedding smalltalkish directly into another language), is as well.
I don't think one needs to know Smalltalk to know much about OO. One
might need to know Smalltalk to understand the history and perhaps some
rationale of OO, _maybe_, but at this point-- the pure theory of OOP is
taught and discussed far and wide entirely outside of the context of
Smalltalk. Smalltalk may have originated it and may be one of the purest
forms of the concept, but...
To say you can't really know "much about" OOP without knowing "much
about" Smalltalk seems basically, well, wrong.
--
... Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
More information about the Python-list
mailing list