instead of type(...) is .... use 

```
isinstance()