Was this addressed?  I often index using tuples.   One could use `isinstance(i, (list, tuple)) or isinstance(j, (list tuple)`

If you wanted to be more general you could us `iterable` as @ness01 suggests.  This is a bit odd when it comes to non-ordered collections like sets.  numpy doesn't support these.