Slightly grim: add a method to group objects to export their elements as
some useful type, and then call that from the element print function.
h ^= 2*hash(info.r) & 0xffffffff
h ^= 5*hash(info.g) & 0xffffffff
return h
h ^= 2*hash(info.r) & 0xffffffff
h ^= 5*hash(info.g) & 0xffffffff
return h
+ def _get_geval(me, x): return MP(x)
_augment(PrimeGroup, _tmp)
class _tmp:
_augment(PrimeGroup, _tmp)
class _tmp:
h ^= 2*hash(info.r) & 0xffffffff
h ^= 5*hash(info.g) & 0xffffffff
return h
h ^= 2*hash(info.r) & 0xffffffff
h ^= 5*hash(info.g) & 0xffffffff
return h
+ def _get_geval(me, x): return GF(x)
_augment(BinGroup, _tmp)
class _tmp:
def __hash__(me): return 0x0ec23dab ^ hash(me.info)
_augment(BinGroup, _tmp)
class _tmp:
def __hash__(me): return 0x0ec23dab ^ hash(me.info)
+ def _get_geval(me, x): return x.toec()
_augment(ECGroup, _tmp)
class _tmp:
def __repr__(me):
return '%r(%r)' % (me.group, str(me))
_augment(ECGroup, _tmp)
class _tmp:
def __repr__(me):
return '%r(%r)' % (me.group, str(me))
- _repr_pretty_ = _pp_str
+ def _repr_pretty_(me, pp, cyclep):
+ pp.pretty(type(me)._get_geval(me))
_augment(GE, _tmp)
###--------------------------------------------------------------------------
_augment(GE, _tmp)
###--------------------------------------------------------------------------