title: using private method in your constructor python
body: <p>I am quite new to <code>OOP</code> in <code>Python</code> and I love the way it works. So I am experimenting a lot with it. I am trying to build a <code>Freelancer class</code> that allow users to register on a platform with a <code>username</code> but checks that the <code>username</code> does not exist in the database.</p>
  
  <p>Here is my working approach:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Freelancer:
      """Leaving this blank for now while I explore the functionality """
      number_of_sales = 0
      available_niches = ["Graphic design", "Art", "Data Analysis", "Music", "Business", "Writing and Translations"]
      usernames = []
  
      def __init__(self, username):
          self.username = _check_username(username)
  
      def _check_username(self, username):
          if self.username in Freelancer.usernames:
              print("This username already exist on our database, consider choosing another one")
          else:
              self.username = username
              Freelancer.usernames.append(self.username)
              print("You have successfully setup a username on our platform")
  
  </code></pre>
  
  <p>Testing this class and method here:</p>
  
  <pre class="lang-py prettyprint-override"><code>David = Freelancer("dave23")
  </code></pre>
  
  <p>Gives me the following error:</p>
  
  <pre><code>NameError: name '_check_username' is not defined
  </code></pre>
  
  <p>I would like a way to apply <code>private methods</code> in my <code>class initialization</code>. Is this possible?</p>