title: Why does Jython not enforce the interface requirements of a Java Interface
body: <p>In Java, I am used to compiler errors when failing to implement all the required methods of an interface.  I was surprised when I made an Object in Jython that did not implement all the required methods (getRowCount, getColumnCount, getValueAt) of the javax.Swing.AbstractTableModel which implements the interface TableModel.  From the <a href="https://docs.oracle.com/javase/7/docs/api/javax/swing/table/AbstractTableModel.html" rel="nofollow noreferrer">Javadocs of AbstractTableModel</a>:</p>
  
  <blockquote>
    <p>To create a concrete TableModel as a subclass of AbstractTableModel you need only provide implementations for the following three methods:</p>
  </blockquote>
  
  <p>Jython class that should fail:</p>
  
  <pre><code>class ResourceTableModel(AbstractTableModel):
      COLUMN_NAMES = ('path','filename','parametername', 'parametervalue')
      def __init__(self, *rows):
          self.data = list(rows)
      def getRowCount(self):
          return len(self.data)
      def getColumnCount(self):
          return len(self.COLUMN_NAMES)
  </code></pre>
  
  <p>Testing the above:</p>
  
  <pre><code> def test_column_count(self):
          e = mySwingGUI.ResourceTableModel()
          column_count = e.getColumnCount()
          self.assertEqual(column_count,4)
  </code></pre>
  
  <p>Then I read that you can use isinstance() to see if an object is an instance of a specific interface.</p>
  
  <p>so I tried this:</p>
  
  <pre><code> def test_column_count(self):
          e = mySwingGUI.ResourceTableModel()
          if isinstance(e,javax.swing.table.AbstractTableModel):
              print("true")
          else:
              print("false")
          column_count = e.getColumnCount()
          self.assertEqual(column_count,4)
  </code></pre>
  
  <p>but it prints true even though I have not implemented all the methods.  Is there a way to make Jython enforce interface contracts or is this only enforced by the Java compiler?</p>