Skip to main content

Python class

BaseContextType

BaseContextType

class max.pipelines.modeling.types.BaseContextType

source

Type variable for generic programming with BaseContext implementations.

This TypeVar is bound to BaseContext, meaning it can represent any type that implements the BaseContext protocol. It enables type-safe generic functions and classes that work with any BaseContext subtype while preserving the specific type information through the type system.

def process_context(context: BaseContextType) -> BaseContextType:
    # Function that accepts any BaseContext implementation
    # and returns the same type
    ...

alias of TypeVar(‘BaseContextType’, bound=BaseContext)