`list`, `tuple`, and `ndarray` objects are ordered sequences meaning if you put element `X` at index `i` it will remain there for the lifetime of the object. `dict` objects and Python `Mapping` objects cannot generally make the same guarantee. So, in the following code

```python
def _is_sequence(x):
    try:
        iter(x)
        len(x) # it has a length
        return not isinstance(x, basestring) and True
    except Exception:
        return False
```

a `dict` object is both iterable and has a length.