To make a method or attribute private

Steven D'Aprano steve+comp.lang.python at
Thu Jan 17 03:38:58 CET 2013

On Thu, 17 Jan 2013 08:34:22 +0800, iMath wrote:

> <div><div>To make a method or attribute private (inaccessible from the
> outside), simply start its </div><div>name with two
> underscores</div><div><br></div><div>----《Beginning Python From Novice
> to Professional》</div><div><br></div><div>but there is another saying
> goes:</div><div>Beginning a variable name with a single underscore
> indicates that the variable should be treated as
> ‘private’.</div><div><br></div><div> ...

Please do not send HTML emails to this newsgroup.


More information about the Python-list mailing list