Would something like this be good here?

    self = S(self)
    other = S(other)
    if self.is_polynomial() and other.is_polynomial():
        quo, rem = div(self, other) 
    else:
         raise TypeError(msg % (type(self).__name__, type(other).__name__))`