Fix python version of isinstance

isinstance function was checking the String "foo" instead of the variable foo. 
And added a check for int to match the scala example.