INNER CODE UNIT · Python

from_context

volfpeter/htmy · htmy/core.py:131

    def from_context(cls, context: Context) -> Self: ...

    @overload
    @classmethod
    def from_context(cls, context: Context, default: None) -> Self | None: ...

    @overload
    @classmethod
    def from_context(cls, context: Context, default: Self) -> Self: ...

    @classmethod
    def from_context(cls, context: Context, default: Self | None = _MISSING) -> Self | None:
        """
        Looks up an instance of this class from the given context.

        Arguments:
            context: The context the instance should be loaded from.
            default: The default to use if no instance is found in the context. If omitted,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…