`__len__` isn't what you want, because your entries must be ordered and sets, dicts, etc. have `__len__` but no order. Your best choice is probably `isinstance(n_clusters, collections.Sequence)` though this happens to include strings, and exclude numpy arrays. See http://docs.python.org/2/library/collections#collections-abstract-base-classes. Note that -- as opposed to its Java equivalent, for example -- Python >=2.6, `isinstance` [may be used for ducktyping](http://www.python.org/dev/peps/pep-3119) via the `__instancecheck__` method of an abstract base class.

Another pythonic way to do this is with
```python
try:
  n_row_clusters, n_column_clusters = n_clusters
except ValueError:
  ...
```
but this also admits any iterable...