perform a type test instead of type(x) == types.FoobarType. In example for type().
Attach a file by drag & drop or click to upload