Will python never intend to support private, protected and public?

Simon Brunning simon.brunning at gmail.com
Thu Sep 29 11:47:28 EDT 2005


On 9/29/05, could ildg <could.net at gmail.com> wrote:
> **Encapsulation** is one of the 3 basic characteristics of OOP.

Pyhton has encapsulation. On objetcts members are encapsulated in a
namespace all of its own. You can't change these by accident.

> Every programmer is  just a human being, but not God. Our life is limited,
> our time is limited, so we need to use convenient tools to save time.
> Private variables guarantee that we will never make stupid mistakes

Private variables prevent the developer of the *client* of a class
from making a small subset of all possible stupid mistakes. But if the
developer of the classitself is mistaken in marking a variable as
private, and if the language enforces this, then there is nothing at
all that the client can do to fix it. Why should the developer of the
class be more likely to be god-like than the user of the class? This
has happened to me more than once.

--
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list