void () { doTest("Dict[str, int]", """ expr = dict() expr['d'] = 12 """ ); doTest("Dict[str, Union[int, str]]", """ expr = dict({'a': 1, 'b': 2}) expr['a'] = '12' """ ); doTest("Dict[str, Union[int, str]]", """ expr = dict(zip(['a', 'b', 'c'], [1, 2, 3])) expr['d'] = '12' """ ); doTest("Dict[str, Union[int, str]]", """ expr = dict(zip(['a', 'b', 'c'], [1, 2, 3])) expr['d'] = '12' """ ); doTest("Dict[str, Union[int, str]]", """ expr = dict([('two', 2), ('one', 1), ('three', 3)]) expr['d'] = '12' """ ); doTest("Dict[str, Union[int, Any]]", """ expr = dict({'a': 1, 'b': 2}) expr['a'] = var """ ); doTest("Dict[Union[str, Any], Union[int, Any]]", """ expr = dict(var) expr.update({'c': 12}) """ ); doTest("Dict[str, Union[int, str]]", """ a, expr = 23, dict({'a': 1}) expr.update({'c': '34'}) """ ); doTest("Dict[str, int]", """ def f(): expr = dict({'a': 1}) def inner(): expr['b'] = 'a' """ ); }