scamp_extensions.utilities.sequences.sequence_depth

scamp_extensions.utilities.sequences.sequence_depth(seq: Sequence) int[source]

Find the maximum _depth of any element in a nested sequence. Slightly adapted from pillmuncher’s answer here: https://stackoverflow.com/questions/6039103/counting-depth-or-the-deepest-level-a-nested-list-goes-to

Parameters:

seq – a nested Sequence (list, tuple, etc)

Returns:

int representing maximum _depth