title: raise TypeError exception for incorrect input value in a class
body: <p>I am trying to write a <code>class</code> and I want that if the initial input values for the class don't obey specific types, it would raise an exception. For instance I would use <code>except TypeError</code> to return an error. I don't know how it should be done though. My first attempt to write the <code>class</code> is as following: </p>
  
  <pre><code>class calibration(object):
        def __init__(self, inputs, outputs, calibration_info, interpolations=2):
            try:
              self.inputs=inputs
            except TypeError
  
            self.outputs=outputs
            self.cal_info=calibration_info
            self.interpol=interpolations
  </code></pre>
  
  <p>I would like that if <code>inputs</code> value is not a string then it raises an error message. I would appreciate for any help.</p>