code: def _commonParent(zi1, zi2):
      
      shorter, longer = sorted([_linearize(x)[::-1] for x in zi1, zi2],
                               key=len)
      for n in range(len(shorter)):
          if shorter[n] != longer[n]:
              if n == 0:
                  return None
              return shorter[n-1]
      return shorter[-1]
docs: Locate the common parent of two Interface objects.
  
      @param zi1: a zope Interface object.
  
      @param zi2: another Interface object.
  
      @return: the rightmost common parent of the two provided Interface objects,
      or None, if they have no common parent other than Interface itself.