class BaseRat (object):
"""Base class implementing fields of fractions over Euclidean domains."""
def __new__(cls, a, b):
- a, b = cls.RING(a), cls.RING(b)
+ a, b = cls.RING._implicit(a), cls.RING._implicit(b)
q, r = divmod(a, b)
if r == cls.ZERO: return q
g = b.gcd(r)
pp.pretty(me.a); pp.text(','); pp.breakable()
pp.pretty(me.b)
pp.end_group(ind, ')')
+ def fromstring(str): return _checkend(ECCurve.parse(str))
+ fromstring = staticmethod(fromstring)
def frombuf(me, s):
return ecpt.frombuf(me, s)
def fromraw(me, s):
h ^= hash(me.curve)
h ^= 2*hash(me.G) & 0xffffffff
return h
+ def fromstring(str): return _checkend(ECInfo.parse(str))
+ fromstring = staticmethod(fromstring)
def group(me):
return ECGroup(me)
_augment(ECInfo, _tmp)