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.
Yes I get that. But with two generators, the output isn't what one would expect. All the values gets overwritten to 3.