str_x = 'int_value=233/str_value=hello'
dict_x = dict(element.split('=') for element in str_x.split('/'))
print(dict_x)
print(int(dict_x['int_value']))
print(dict_x['str_value'])
这段代码可以正常运行,但是为什么放到 pycharm 里爆黄呢,请问怎么改才能不爆黄呢?
dict()里边爆黄:
Unexpected type(s): (Generator[List[str], Any, None]) Possible type(s): (SupportsKeysAndGetItem[List[str], _VT]) (Iterable[Tuple[Any, Any]])