No subject

Tom Anderson twic at urchin.earth.li
Sat Jul 2 16:11:54 CEST 2005


On Fri, 1 Jul 2005, Andreas Kostyrka wrote:

> Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis:
>
>>> Again, how? Is there a way to force that an external user of my lib can
>>> not use my internal data/methods/classes, unless he uses odd compiler
>>> hacks?
>>
>> I never understood how mainstream OO languages expect the designer of a 
>> class to know in advance that an attribute should be hidden or 
>> unnecessary to its subclasses by being declared "private" instead of 
>> "protected".
>
> The problem is, that the classic private/protected/public visibility
> tags try to solve multiple problems.
>
> Private: Ok, that's all that's really only for the implementation.
> public: Well, that's all for my "customers". Hmm. What if I've got two
> kinds of customers? Say a customer like in bank customer, and second
> customer that plays the role of the bank employee? oops.

C++ has 'friend' for that:

http://www.cplusplus.com/doc/tutorial/tut4-3.html

tom

-- 
REMOVE AND DESTROY



More information about the Python-list mailing list