lib.typechecks.*
Functions for checking types and type likeness
Provides
-
lib.typechecks.check_shape_validity(shape, maxshape)[source]
Checks if shape is valid
- Parameters:
-
- Return type:
bool
- Returns:
True if yes, raises a ValueError otherwise
-
lib.typechecks.is_stringlike(obj)[source]
Is obj string like
- Parameters:
obj (object
) – Object to be checked
- Return type:
bool
- Returns:
True if obj is instance of str, bytes or bytearray
-
lib.typechecks.is_svg(svg_bytes)[source]
Checks if svg_bytes is an svg image
- Parameters:
svg_bytes (bytes
) – Data to be checked for being an SVG image
- Return type:
bool
- Returns:
True if svg_bytes seems to be an SVG image