I have a variable \"myvar\" that when I print out its type(myvar)
type(myvar)
the output is:
If
Use isinstance, this will return true even if it is an instance of the subclass:
if isinstance(x, my.object.kind)
Or:
type(x) == my.object.kind #3.x
If you want to test all in the list:
if any(isinstance(x, my.object.kind) for x in alist)