(self, other)
return None
This InnerJoin is a superset of another TableDefinition if either:

     - other is a TableAlias (or None) equal to our
       left_side. I.e. "other" is at the end of it's inner-join chain.

     - other is an InnerJoin, and it's left-side is equal to our
       left-side (both TableAliases or None), and our right-side is a
       super-set of it's right-side.
This InnerJoin is a superset of another TableDefinition if either:
This InnerJoin is a superset of another TableDefinition if either :
def getSuperSet(self, other):
    """This InnerJoin is a superset of another TableDefinition if either:

     - other is a TableAlias (or None) equal to our
       left_side. I.e. "other" is at the end of it's inner-join chain.

     - other is an InnerJoin, and it's left-side is equal to our
       left-side (both TableAliases or None), and our right-side is a
       super-set of it's right-side.
    """
    if self.left_tabledef == other:
      # other and left-side are both None or matching TableAliases
      return self
    if (isinstance(other, InnerJoin) and
        self.left_tabledef == other.left_tabledef):
      # our left-sides match. If one of our right sides is a superset of the
      # other right side, then we found the superset
      sub_superset = self.right_tabledef.getSuperSet(other.right_tabledef)
      if sub_superset is self.right_tabledef:
        return self
      elif sub_superset is other.right_tabledef:
        return other
      return None
    return None
def getSuperSet ( self , other ) : if self . left_tabledef == other : # other and left-side are both None or matching TableAliases return self if ( isinstance ( other , InnerJoin ) and self . left_tabledef == other . left_tabledef ) : # our left-sides match. If one of our right sides is a superset of the # other right side, then we found the superset sub_superset = self . right_tabledef . getSuperSet ( other . right_tabledef ) if sub_superset is self . right_tabledef : return self elif sub_superset is other . right_tabledef : return other return None return None