def smul(self, a, b):
    ' Return a*b where a or b is scalar\n        '
    if (not isinstance(b, FieldElem)):
        return FieldElem(((gmpy.mpz(b) * a.val) % self.p), self)
    else:
        return self.smul(b, a)
Return a*b where a or b is scalar
def smul(self, a, b):
    ' \n        '
    if (not isinstance(b, FieldElem)):
        return FieldElem(((gmpy.mpz(b) * a.val) % self.p), self)
    else:
        return self.smul(b, a)