from collections.abc import Callable class REAL: def __init__(self, f: Callable[[int], str]) -> None: self.binseq = f def as_string(self, w: int) -> str: s = "" for n in range(w): s += self.binseq(n) return s