Why does python not have a mechanism for data hiding?

Fuzzyman fuzzyman at gmail.com
Sat May 24 13:22:17 EDT 2008


On May 24, 6:18 pm, bearophileH... at lycos.com wrote:
> Ben Finney:
>
> >In Python, the philosophy "we're all consenting adults here" applies.<
>
> Michael Foord:
>
> > They will use whatever they find, whether it is the best way to
> > achieve a goal or not. Once they start using it they will expect us to
> > maintain it - and us telling them it wasn't intended to be used by
> > them in the first place won't cut it.
>
> So they will use the methods with one or two underscores too. And
> imply that you want to document them too.
> They don't seem adult enough, then ;-)


Great! We'll just tell them that...

Michael

> Internal API hiding seems quite less useful if you don't need to let
> customers manage your code.
>
> Bye,
> bearophile




More information about the Python-list mailing list