Idiomatic Python: use isinstance instead of type
Idiomatic Python: use in operator instead of method find