pyxx.arrays.check_len_equal#

pyxx.arrays.check_len_equal(item1: Any, item2: Any, *args: Any)#

Checks whether the lengths of a set of sequence-type objects are equal

Evaluates the lengths of a set of items (such as lists, tuples, or strings), returning whether all items have the same length as well as either the length of all items (if all lengths are equal) or a list containing the lengths of each item (if they are not equal).

Parameters:
  • item1 (Any) – First item whose length to evaluate

  • item2 (Any) – Second item whose length to evaluate

  • *args (Any, optional) – Any other items whose lengths are to be evaluated

Returns:

  • bool – Whether all items have the same length

  • int or list – Returns an integer containing the length of all items (if all lengths are equal), or a list containing the lengths of each item (if lengths differ)

See also

is_len_equal

Identical functionality, but returns only the bool output and may theoretically run slightly faster in cases where the length(s) of the inputs does not need to be returned