This not Pythonic: you want to just test for the functionality you're looking for, instead of requiring a specific type. This principle is called [duck typing](https://en.wikipedia.org/wiki/Duck_typing), and it makes the code more easily extensible and more easily testable.