Maybe use this instead

```python
if isinstance(var, collections.Iterable):
```