Pyre dictionary typing

678 views Asked by At

I'm attempting to fix typing errors in my program with pyre. I have the following snippet, that works when it is run.

my_dict = dict(my_list=[], notes='')
my_dict["notes"] = "pyre"
print(my_dict["notes"])

That makes the error:

test.py:2:19 Incompatible parameter type [6]: Expected `typing.Union[typing_extensions.Literal[''], typing.List[typing.Any]]` for 2nd positional only parameter to call `dict.__setitem__` but got `typing_extensions.Literal['pyre']`.

I am unsure how to fix this typing issue.

0

There are 0 answers