I need to check if an argument is a type class. Not if an argument is of a specific type like int, but that is a type.
Here's some code illustrating what I want to achieve:
def is_type(arg):
if arg is a type:
return True
return False
is_type(int) # true
is_type(str) # true
is_type(23) # false
is_type(type(23)) # true
What should the body of is_type
be to achieve this? I tried if arg is type:
but that's didn't work.