I want to check if the type of a variable is: dict[str, Any]. (in python)
What I have tried (unsuccessfully) is this:
myvar = {
'att1' : 'some value',
'att2' : 1
}
if not isinstance(myvar, dict[str, Any]):
raise Exception('Input has the wrong type')
I get the following error message:
TypeError: isinstance() argument 2 cannot be a parameterized generic
How should I do this?
Thank you!