str2d.Str2D.validate_fill

classmethod Str2D.validate_fill(fill: str | Tuple[str, int] | None = None) Tuple[str, int][source]

Validate the fill value. The fill value is a tuple containing the fill character and fill alpha value. The fill character is a single character and the fill alpha value is 0 or 1. This validator will accept a single character or a tuple containing a single character and an integer. If a single character is passed, the fill alpha value will be 0. If a tuple is passed, the fill character will be the first element and the fill alpha value will be the second.

Parameters:

fill (Optional[Union[str, Tuple[str, int]]], optional) – The fill value, by default None

Returns:

A tuple containing the fill character and fill alpha value.

Return type:

Tuple[str, int]

Raises:

ValueError – If the fill value is not a single character or a tuple containing a single character and an integer or if the fill alpha value is not 0 or 1.