IsPython really O-O?

Roy Smith roy at panix.com
Sat Nov 10 20:41:13 EST 2001


<kentsmith at dxsys.com> wrote:
> Is Python not "really" appropriate for true O-O applications, in the 
> sense that Viz-Age Smalltalk and Eifel and so on are???

I've never been accused of worrying too much about what's appropriate, so 
maybe this answer isn't going to be either :-)

The typical complaint I hear from people when they say Python isn't O-O 
enough for them, is that it doesn't have private data.  The hard-core O-O 
zealot will insist that the only way to access data inside of an object 
should be through explicit set/get functions.

I'll admit that there is value to the private/set/get way of life, and 
sometimes I do wish Python worked that way.  It certainly does give you 
some protections that would be nice to have.  For example, you wouldn't 
need warnings such as (from the documentation for string.whitespace):

"Do not change its definition -- the effect on the routines strip() and 
split() is undefined."

On the other hand, I'm too busy writing programs in Python that do useful 
things with a minimum of fuss to worry about whether it's "true O-O" or 
not.  I'll leave that argument to comp.lang.oo.religious-wars.



More information about the Python-list mailing list