all_size

Stoner.tools.all_size(iterator: Iterable, size: Optional[Union[int, Tuple]] = None) bool[source]

Check whether each element of iterator is the same length/shape.

Parameters

iterator (Iterable) – list or other iterable of things with a length or shape

Keyword Arguments

size (int, tuple or None) – Required size of each item in iterator.

Returns

True if all objects are the size specified (or the same size if size is None).