If I have a string which is the same as a python data type and I would like to check if another variable is that type how would I do it? Example below.
dtype = 'str'x = 'hello'bool = type(x) == dtype
The above obviously returns False but I'd like to check that type('hello') is a string.