Why does python not have a mechanism for data hiding?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Jun 5 07:19:19 EDT 2008


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.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list