From: Phrogz Date: 2007-03-17T23:35:10+09:00 Subject: Re: A couple of questions from a Ruby neophyte On Mar 10, 6:12 am, r...@dot.com (Lawrence Oluyede) wrote: > > Python > > ------ > > arr.append(value) # OO, parenthesis NOT optional > > len(arr) # non-OO, albeit it can be overridden > > There's a bit of misunderstading of what's called OOP in regard of > "message(object)" or "object.message" but I don't want to start a > religious war here. Suffice to say that arr or an object who wants to > mimic that behavior must implement a __len__ method so I don't really > understand why that's not OOP. Smalltalk does use a similar syntax and I > will not be the one stating that ST is not OO ;-) I don't know Python, so answer me this: With that required __len__ method, can you write arr.__len__() to find out the length? Does the built-in array class have any more conveniently-named method you can call to find the length of the array? If the answer to those is "no", then it's no OO because you have a global function that works on a specific object (or set of objects) and cannot thus be used with other objects. Requiring the use of a single global namespace to call functions is not OO, by my definition.