I have a function whose argument is a list of dictionaries. I am trying to specify the type of elements for the dictionary in the function argument. The dictionary has the following form:
{'my_object':my_object, 'data':int}
my_object is a custom datatype. Is there any way to specify the type of dictionary, something like the one in below:
def my_function(x : list[dict[my_object, int]]):
Python complains about how I defined the type and gives me the following error:
TypeError: 'type' object is not subscriptable