Will python never intend to support private, protected and public?
Gregor Horvath
g.horvath at gmx.at
Thu Sep 29 00:58:27 EDT 2005
Paul Rubin schrieb:
> allowed to do that--that's why the variable is private. Is he
> supposed to get your permission every time he wants to change how the
> private variables in his class work?
>
No, but the assumption here is that the maintainer / designer of a class
alaways knows everything and things are static. Unfortunatly this is
wrong in real live.
When you use a _ variable in python you know that this may break in the
future because of changing interfaces. Thats a typical engineering Trade
Off on my side.
One that is in other languages not even possible. A clear disadvantage.
Python gives me power and does not take it away like the others.
> stuff off. And it's certainly not intended for normal classes in an
> application to get at the private variables of other classes.
>
So is in Python. It is certainly not intended to use _ variables.
But you can do it, at your own risk. I do not need an authority that
forbiddes things, but one that guides in the correct direction without
coming in my way.
The engineering decisions regarding my application should be on my side,
not the language lawyers.
--
Greg
More information about the Python-list
mailing list