title: Python checking __init__ parameter
body: <p>I've been trying to figuring this out for the last few hours, and I'm about to give up.</p>
  
  <p>How do you make sure that in python only a matching specific criteria will create the object?</p>
  
  <p>For example, let's say I want to create an object Hand, and initialize a Hand only when I have enough Fingers in the initializer?  (Please just take this as an analogy)</p>
  
  <p>Say,</p>
  
  <pre><code>class Hand:
    def __init__(self, fingers):
      # make sure len(fingers)==5, and 
      #only thumb, index, middle, ring, pinky are allowed in fingers
      pass
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>These are the closest questions I found, but one is in C++, the other does not answer my question.</p>
  
  <p><a href="https://stackoverflow.com/questions/7361077/checking-of-constructor-parameter">checking of constructor parameter</a></p>
  
  <p><a href="https://stackoverflow.com/questions/141545/overloading-init-in-python">How to overload __init__ method based on argument type?</a></p>