title: Python name mangling
body: <p>In other languages, a general guideline that helps produce better code is always make everything as hidden as possible. If in doubt about whether a variable should be private or protected, it's better to go with private.</p>
  
  <p>Does the same hold true for Python? Should I use two leading underscores on everything at first, and only make them less hidden (only one underscore) as I need them?</p>
  
  <p>If the convention is to use only one underscore, I'd also like to know the rationale.</p>
  
  <p>Here's a comment I left on <a href="https://stackoverflow.com/questions/7456807/python-name-mangling-when-in-doubt-do-what/7456958#7456958">JBernardo's answer</a>. It explains why I asked this question and also why I'd like to know why Python is different from the other languages:</p>
  
  <blockquote>
    <p>I come from languages that train you to think everything should be only as public as needed and no more. The reasoning is that this will reduce dependencies and make the code safer to alter. The Python way of doing things in reverse -- starting from public and going towards hidden -- is odd to me.</p>
  </blockquote>