Why does python not have a mechanism for data hiding?

Russ P. Russ.Paielli at gmail.com
Mon Jun 9 20:17:37 CEST 2008


On Jun 9, 2:23 am, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> Mark Wooding a écrit :
>
>
>
> > Fuzzyman <fuzzy... at gmail.com> wrote:
>
> >> So, you are stating that no API programmer using Python *ever* has a
> >> valid or genuine reason for wanting (even if he can't have it) genuine
> >> 'hiding' of internal state or members from consumers of his (or
> >> her...) API?
>
> > I don't want to speak for whoever you were responding to, but from my
> > point of view...
>
> > Yes.
>
> > I understand the difference between the documented interface of a system
> > and the details of its implementation.  But sometimes it can be useful
> > to take advantage of implementation details, particularly if the
> > published interface is inadequate in some way.  Whether or not I choose
> > to make use of implementation details is a trade-off between immediate
> > convenience and maintainability, but that's something I can make a
> > rational decision about.
>
> > By enforcing your `data hiding', you're effectively telling me that I'm
> > too stupid to make rational decisions of this sort.  And that's actually
> > extremely insulting.
>
> I couldn't state it better. +1QOTW btw.

Please see my previous reply to that post.

Being "insulted" by data hiding is the "QOTW"? I'd call that an insult
to everyone else who has posted on this forum in the past week. Unless
of course you mean "silliest QOTW."



More information about the Python-list mailing list