INNER CODE UNIT · Python

__iter__

althonos/pyhmmer · src/pyhmmer/utils.py:30

    def __iter__(self) -> "peekable[_T]":
        return self

    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.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…