Use isinstance to make it work for subclasses of dict and list
Merge pull request #1 from svisser/patch-1

Use isinstance to make it work for subclasses of dict and list