Preventing direct access to a class

Daniel Klein danielk at
Sun Feb 4 16:50:57 EST 2001

On 4 Feb 2001 12:58:32 -0800, aahz at (Aahz Maruch) wrote:

>In article <dc4r7t41dchrbrdabst1ung9mop3u4dnoj at>,
>Daniel Klein  <danielk at> wrote:
>>I have a situation where I need to prevent direct access to a class. 
>BTW, the standard Python idiom for declaring this is to precede the
>class name with a single underscore (see for a real
>class _foo:
>    pass

Yes, I see. But this only prevents access to class A if the user does


More information about the Python-list mailing list