This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients LucianU, docs@python, eric.araujo, meatballhat, skip.montanaro
Date 2010-05-07.11:13:38
SpamBayes Score 2.3297844e-06
Marked as misclassified No
Message-id <1273230821.32.0.414160027863.issue8638@psf.upfronthosting.co.za>
In-reply-to
Content
Maybe the wording should be changed, but name mangling serves a useful
purpose.  There are two definitions of "private" which seem to be a
bit conflated in this section:

* "private" as in, "this name is not part of the public API - use it
  at your own risk".

* "private" as in, "I don't want someone to accidentally stomp on this
  attribute name when subclassing this class".

I think it is valuable to mention both of these conventions in the
tutorial for a couple reasons:

* the tutorial is meant for people new to Python but with experience
  in other programming languages

* the distinction between _a and __a is a bit subtle and not obviously
  similar to privacy features present in other languages.

I work with a lot of C++ programmers who also write some Python
(sometimes a lot of Python).  It's clear at times that the distinction
hasn't always sunk in.
History
Date User Action Args
2010-05-07 11:13:41skip.montanarosetrecipients: + skip.montanaro, eric.araujo, meatballhat, LucianU, docs@python
2010-05-07 11:13:41skip.montanarosetmessageid: <1273230821.32.0.414160027863.issue8638@psf.upfronthosting.co.za>
2010-05-07 11:13:39skip.montanarolinkissue8638 messages
2010-05-07 11:13:38skip.montanarocreate