Re: To make a method or attribute private

Discussion in 'Python' started by Steven D'Aprano, Jan 17, 2013.

  1. 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&nbsp;</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
    Steven D'Aprano, Jan 17, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daz
    Replies:
    3
    Views:
    86
    Matt Kruse
    May 11, 2007
  2. alex23
    Replies:
    2
    Views:
    146
    Steven D'Aprano
    Jan 20, 2013
  3. Lie Ryan
    Replies:
    0
    Views:
    101
    Lie Ryan
    Jan 18, 2013
  4. iMath
    Replies:
    5
    Views:
    119
    Mitya Sirenef
    Jan 21, 2013
  5. iMath
    Replies:
    4
    Views:
    114
    alex23
    Jan 21, 2013
Loading...

Share This Page