From: Michael Torrie on 28 Jun 2010 15:52 On 06/27/2010 11:58 PM, Stephen Hansen wrote: > To say you can't really know "much about" OOP without knowing "much > about" Smalltalk seems basically, well, wrong. True. But you can't really criticize a language's implementation of OOP without a good understanding of the "pure" OO language. For example, in Smalltalk If/Then statements are actually methods of Boolean objects. >From a certain point of view that's extremely appealing (consistent, anyway). Almost functional in nature. They are not implemented this way in Python, so that's one thing you could argue is not OO about Python.
From: Aahz on 28 Jun 2010 16:31 In article <mailman.2300.1277754755.32709.python-list(a)python.org>, Michael Torrie <torriem(a)gmail.com> wrote: >On 06/27/2010 11:58 PM, Stephen Hansen wrote: >> >> To say you can't really know "much about" OOP without knowing "much >> about" Smalltalk seems basically, well, wrong. > >True. But you can't really criticize a language's implementation of OOP >without a good understanding of the "pure" OO language. For example, in >Smalltalk If/Then statements are actually methods of Boolean objects. >>From a certain point of view that's extremely appealing (consistent, >anyway). Almost functional in nature. They are not implemented this >way in Python, so that's one thing you could argue is not OO about Python. Python is in no way a pure OOP language. (I assume you're aware of this, but your phrasing leaves that in doubt.) -- Aahz (aahz(a)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
From: Michael Torrie on 28 Jun 2010 17:05 On 06/28/2010 02:31 PM, Aahz wrote: > In article <mailman.2300.1277754755.32709.python-list(a)python.org>, > Michael Torrie <torriem(a)gmail.com> wrote: >> True. But you can't really criticize a language's implementation of OOP >> without a good understanding of the "pure" OO language. For example, in >> Smalltalk If/Then statements are actually methods of Boolean objects. >> >From a certain point of view that's extremely appealing (consistent, >> anyway). Almost functional in nature. They are not implemented this >> way in Python, so that's one thing you could argue is not OO about Python. > > Python is in no way a pure OOP language. (I assume you're aware of this, > but your phrasing leaves that in doubt.) My phrasing leaves that in doubt? How does my example of how Smalltalk implements if/then vs how Pyton's implementation leave that in doubt? The last sentence alone is very clear.
From: Mark Lawrence on 28 Jun 2010 17:37 On 28/06/2010 20:23, Alexander Kapps wrote: > Alexander Kapps wrote: >> Bruno Desthuilliers wrote: >>> Alexander Kapps a écrit : >>> (snip) >>>> While I personally don't agree with this proposal (but I understand >>>> why some people might want it), I can see a reason. >>>> >>>> When disallowing direct attribute creation, those typos that seem to >>>> catch newcommers won't happen anymore. What I mean is this: >>>> >>>> class Foo(object): >>>> def __init__(self): >>>> self.somearg = 0 >>>> >>>> f = Foo() >>>> f.soemarg = 42 >>>> >>>> ---^ There, typo, but still working >>>> >>>> It's something like a custom __setattr__ that errors out when trying >>>> to assign to an attribute that doesn't exists, >>> >>> Chicken and egg problem, really : f.__dict__['somearg'] doesn't >>> exists until "self.somearg = 0" is executed. >>> >>> The "problem" is that Python's methods are only thin wrapper around >>> functions (cf http://wiki.python.org/moin/FromFunctionToMethod) so >>> there's no difference between "self.somearg = 0" in Foo.__init__ and >>> "f.somearg = 42". >>> >>> IOW, there's no way to implement this proposal without completely >>> changing Python's object model. >> >> I must be missing something. Can you please explain why the whole >> object model would need to change? > > UHHM! Forget it. This of course doesn't work with setattr too. My > stupidness. :-( > > Don't worry too much, looks like your nation's football is much better than your settattr knowledge. I'm now setting up another charity to parallel the home in Dublin for blind Irish referees. [1] Kindest regards. Mark Lawrence [1] google for Max Boyce Irish Referees
From: Bruno Desthuilliers on 29 Jun 2010 04:23
Aahz a �crit : > In article <4c285e7c$0$17371$426a74cc(a)news.free.fr>, > Bruno Desthuilliers <bruno.42.desthuilliers(a)websiteburo.invalid> wrote: >> Aahz a �crit : >>> In article <4c2747c1$0$4545$426a74cc(a)news.free.fr>, >>> Bruno Desthuilliers <bdesth.quelquechose(a)free.quelquepart.fr> wrote: >>>> Python has no pretention at "elegance". >>> That's not true at all. More precisely, I would agree with you if the >>> emphasis is on "pretention" but not if the emphasis is on elegance; >> Python Zen, #9 (or #8 if you're a TrueHacker !-)) > > ...and this implies that Python has no focus on elegance because...? Nope, that was an answer about where the emphasis was in my previous statement. I don't mean Python don't care about or is devoid of elegance, just that it's not the primary concern - hence the "has no pretention at" part. |