On Sat, Jan 23, 2016 at 12:07 PM, Danny Yoo <d...@hashcollision.org> wrote:
> But Python has very little of this as a built-in part of the language. > Guarding who gets to touch something is instead done by convention and > by a very thin mechanism of name-mangling via an uncommonly-seen > character, the underscore "_". > > For a little more discussion about this, we can see the Style > Guidelines, around the part that talks about names: > > https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles > > and we'll see a bunch of recommendations about using underscores for > names when we want to provide a scoping hint to others. One thing I was unaware of: "_single_leading_underscore : weak "internal use" indicator. E.g. from M import * does not import objects whose name starts with an underscore." My current understanding is to avoid "from M import *", but it is good to know that this style of import will not capture names of the form "_name". -- boB _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor