title: How to (should I) implement a model consistency in Python?
body: <p>I'd like to enhance my model's implementation by adding some consistency checks (this value can't be negative, this one can't be None, etc.)</p>
  
  <p>I wondered if it were « Pythonic » to add some « type checking »-ish checks as well. For instance, check that the object that I put in my Car is indeed a SteeringWheel. </p>
  
  <p>I do want to perform some kind of type check in order to catch errors as soon as possible. I want to know if I added a proper SteeringWheel the instant I put it in the Car, not when the Car takes its first turn (and then debugging my way through the car wreck until I find the erroneous assignation).</p>
  
  <p>I read that it would be more in the Python's duck type philosophy to check the added object's attributes or methods instead of its type. I understand this principle, but that would mean that the model must be aware of how the object will be used in order to check that the given object is correct, and that creates a wrong dependency between Model and Controller.</p>
  
  <p>Moreover, what attributes should be tested? <code>wheel.rotate()</code> can apply to a SteeringWheel, but also to a Tire.</p>
  
  <p>Another way would be to let the Model as it is and surround <em>every</em> use of a Model object by a try-catch, expecting a for an <code>AttributeError</code> or a <code>TypeError</code>, and that would be quite cumbersome.</p>
  
  <p>Maybe I'm wrong to want this, and if anyone can convince me that I have the wrong idea, please do. But if you consider I'm right to want a model that raises an error when it becomes inconsistent, can you tell me a way to do that other than using <code>isinstance()</code> ?</p>
  
  <p>Thank you.</p>