It's usually better to use isinstance instead of testing type equality. I'd do this:

```
if not isinstance(parsed, dict):
```