is Python fully object oriented ?

Ben Hutchison benh at intelligenesis.net
Thu Jan 11 20:21:37 EST 2001


Crutoy wrote:

> Hi , i haven't used Python but i do have experience in other languages vb ,
> java , c++ . Is Python a fully object oriented ? Thanks

I have just been considering the same questions myself. I do have a few
concerns with Pythons OO credentials, relative to Java/C++.

1. Most significantly, Python requires the "self" or "this" reference to be
explicitly declared. This seems like a bit of a hassle if you do pure OO
development with python; lots of typing! Suggests perhaps that OO features were
built onto initially procedural language.
eg: Python
    class MyClass:
        def __init__(self, name):
        def doIt(self):
Python with implict self (as in C++, Java)
    class MyClass:
        def __init__(name):
        def doIt():

2. Access control is more informal in Python than C++/Java. I know in the case
of Java at least that security provisions depend in part on access control
being strictly enforced, and additonally there are a number of design
principles that assume 3 tiered (public, protected, private) access levels.
* Is Pythons leading underscore mechanism more of a convention?
* It is strong enough to build security mechanisms on?
* Can a class declare a priviledged API availalbe only to subclasses?


--
Ben Hutchison
Software Engineer-Market Predictor
Webmind Australia
http://www.webmind.com/productspredictor.html





More information about the Python-list mailing list