INNER CODE UNIT · Python

peek

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

    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
    `typeshed <https://github.com/python/typeshed>`_ repository.

    """

    def __init__(self, func: typing.Callable[..., _T]) -> None:
        if not callable(func) and not hasattr(func, "__get__"):
            raise TypeError("{!r} is not callable or a descriptor".format(func))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…