Commit c13e6115 authored by Martin Larralde's avatar Martin Larralde
Browse files

Add `__repr__` implementation to `pyhmmer.easel.Randomness`

parent 6b0e7bcd
......@@ -451,6 +451,7 @@ class Randomness(object):
def __getstate__(self) -> typing.Tuple[typing.Any, ...]: ...
def __setstate__(self, state: typing.Tuple[typing.Any, ...]) -> None: ...
def __sizeof__(self) -> int: ...
def __repr__(self) -> str: ...
def getstate(self) -> typing.Tuple[typing.Any, ...]: ...
def setstate(self, state: typing.Tuple[typing.Any, ...]) -> None: ...
def seed(self, n: typing.Optional[int] = None) -> None: ...
......
......@@ -4011,6 +4011,13 @@ cdef class Randomness:
state = self.getstate()
return Randomness, (state[0], state[1]), state
def __repr__(self):
assert self._rng != NULL
cdef type ty = type(self)
cdef str name = ty.__name__
cdef str mod = ty.__module__
return f"{mod}.{name}({self._rng.seed!r}, fast={self.is_fast()!r})"
def __getstate__(self):
return self.getstate()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment