class _Codec: """Base class for codecs""" implements(IAudioCodec) def __init__(self, samplesize): self.samplesize = samplesize self.b = b'' def buffer_and_encode(self, payload): self.b += payload res = [] while len(self.b) >= self.samplesize: sample, self.b = self.b[:self.samplesize], self.b[self.samplesize:] res.append(self._encode(sample)) return res
class Stringlike(object): implements(IString)
class Bar(object): implements(IBar) def __init__(self, original=None): pass
class Foo(object): implements(IFoo)