pwtools.common.is_seq

pwtools.common.is_seq(seq)[source]

Test if seq is some kind of sequence, based on calling iter(seq), i.e. if the object is iterable.

Exclude cases which are iterable but that we still don’t like (string, file object). In fact, we wish to catch list, tuple, numpy array.

Parameters:

seq ((nested) sequence of arbitrary objects) –