ridgeplot._vendor._typeis module

protocol ridgeplot._vendor._typeis.TypeGuardFunc[source]

Bases: Protocol[~_T]

Classes that implement this protocol must have the following methods / attributes:

__call__(obj)[source]

Call self as a function.

ridgeplot._vendor._typeis.typeis(obj, tp)[source]

Type guard function that checks if the given object is of the given type.

Args:
obj:

The object to check.

tp:

The type to check against.

Returns:

Whether the object is of the given type.

Return type:

bool

ridgeplot._vendor._typeis.register_typeis(tp)[source]

Register a type guard function for a given type.

Args:
tp:

The type to register the type guard function for.

Returns:

A decorator that registers the given type guard function for the given type.

Return type:

Callable[[TypeGuardFunc[_T]], TypeGuardFunc[_T]]