INNER CODE UNIT · Python

IdentityFunction

kr8s-org/kr8s · kr8s/_vendored/asyncache/__init__.py:34

class IdentityFunction(Protocol):  # pylint: disable=too-few-public-methods
    """
    Type for a function returning the same type as the one it received.
    """

    def __call__(self, __x: _T) -> _T: ...


class NullContext:
    """A class for noop context managers."""

    def __enter__(self):
        """Return ``self`` upon entering the runtime context."""
        return self

    def __exit__(self, exc_type, exc_value, traceback):
        """Raise any exception triggered within the runtime context."""
        return None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…