INNER CODE UNIT · Python
__next__
althonos/pyhmmer · src/pyhmmer/utils.py:33
def __next__(self) -> _T:
if self.peeked is not self._sentinel:
self.peeked, item = self._sentinel, self.peeked
else:
item = next(self.it)
return item # type: ignore
def peek(self) -> _T:
if self.peeked is self._sentinel:
self.peeked = next(self.it)
return self.peeked # type: ignore
class singledispatchmethod(typing.Generic[_T]):
"""Single-dispatch generic method descriptor.
Backported from Python 3.8 to support older Python versions. Additional
type annotations were obtained from the `functools` stubs in the Python