You could use `isinstance(other, collections.Sequence)` here to avoid errors with objects that don't support `len`.