To make a method or attribute private
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Wed Jan 16 21:38:58 EST 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.
--
Steven
More information about the Python-list
mailing list