title: How to create Classes in Python with highly constrained instances
body: <p>In Python, there are examples of built-in classes with highly constrained instances.  For example,  "None" is the only instance of its class, and in the bool class there are only two objects, "True" and "False"  (I hope I am more-or-less correct so far).    </p>
  
  <p>Another good example are integers: if a and b are instances of the int type then a == b  implies that a is b.  </p>
  
  <p>Two questions:</p>
  
  <ol>
  <li><p>How does one create a class with similarly constrained instances?  For example we could ask for a class with exactly 5 instances.  Or there could be infinitely many instances, like type int, but these are not arbitrary.  </p></li>
  <li><p>if integers form a class, why does int() give the 0 instance?  compare this to a user-defined class Cl,  where Cl() would give an instance of the class, not <em>a specific unique instance</em>, like 0.   Shouldn't int() return an unspecified integer object, i.e. an integer without a specified value?</p></li>
  </ol>