Why does python not have a mechanism for data hiding?

Antoon Pardon apardon at forel.vub.ac.be
Thu Jun 5 13:30:44 CEST 2008

On 2008-06-05, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> On Thu, 05 Jun 2008 08:21:41 +0000, Antoon Pardon wrote:
>> On 2008-06-04, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
>>> On Wed, 04 Jun 2008 09:34:58 +0000, Antoon Pardon wrote:
>>>> On 2008-06-04, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
>>>>>>> it makes sense to me to also test if they work as documented.
>>>>>> If they affect the behaviour of some public component, that's where
>>>>>> the documentation should be.
>>>>> As I said they are public themselves for someone.
>>>> Isn't that contradictory: "Public for someone" I always
>>>> thought "public" meant accessible to virtually anyone.
>>>> Not to only someone.
>>> For the programmer who writes or uses the private API it isn't really
>>> "private", he must document it or know how it works.
>> How does that make it not private. Private has never meant "accessible
>> to noone". And sure he must document it and know how it works. But that
>> documentation can remain private, limited to the developers of the
>> product. It doesn't have to be publicly documented.
> If the audience is the programmer(s) who implement the "private" API it
> is not private but public.  Even the "public" API is somewhat "private" to
> a user of a program that uses that API.  The public is not virtually
> anyone here.  Depends at which level you look in the system.

I think there is a general consensus about on what level to look when we
are talking about private and public attributes. You can of course
start talking at a whole different level and as such use these words
with a meaning different than normally understood. But that will just
make it harder for you to get your ideas accross.

Antoon Pardon

More information about the Python-list mailing list