Nice solution wanted: Hide internal interfaces

Grant Edwards invalid at invalid.invalid
Mon Oct 29 14:00:58 EDT 2012


On 2012-10-29, Johannes Bauer <dfnsonfsduifb at gmx.de> wrote:
> On 29.10.2012 17:47, Chris Angelico wrote:
>
>> The usual convention for private methods is a leading underscore on the name:
>
> Yup, that's what I'm using.
>
>> It's only a convention, though; it doesn't make it "hard" to call
>> them, it just sends the message "this is private, I don't promise that
>> it'll be stable across versions".
>
> Yes, I know. But it's good enough. I don't want to restrict the use
> under all circumstances, just make it clear to the user what she is
> supposed to use and what not.

The single underscore indicates that the user is not to use the
method.

-- 
Grant Edwards               grant.b.edwards        Yow! I am covered with
                                  at               pure vegetable oil and I am
                              gmail.com            writing a best seller!



More information about the Python-list mailing list