(self, other)
return other.variables == self.variables
Return True if other is a monomial
        and is equivalent to self up to a scalar
        multiple.
Return True if other is a monomial
        and is equivalent to self up to a scalar
        multiple.
Return True if other is a monomial and is equivalent to self up to a scalar multiple .
def equal_upto_scalar(self, other) -> bool:
        """
        Return True if other is a monomial
        and is equivalent to self up to a scalar
        multiple.
        """
        if not isinstance(other, Monomial):
            raise ValueError('Can only compare monomials.')
        return other.variables == self.variables
def equal_upto_scalar ( self , other ) -> bool : if not isinstance ( other , Monomial ) : raise ValueError ( 'Can only compare monomials.' ) return other . variables == self . variables