void () { doTest("Set[int]", """ def f(): expr = set() expr.add(1)""" ); doTest("Set[Union[int, str]]", """ def f(): expr = set({1, 2}) expr.add('abc')""" ); doTest("Set[Union[int, str]]", """ def f(): expr = set({1, 2}) b = {'abc'} expr.update(b)""" ); doTest("Set[Union[int, str]]", """ def f(): expr = set({1, 2}) b = {2, 3} expr.update(b, ['a', 'b'], {1, 2})""" ); doTest("Set[Union[str, Any]]", """ def f(): expr = set() b = {'a', 'b'} expr.update(b, var)""" ); doTest("Set[Union[str, Any]]", """ def f(): expr = set(var) b = {'a', 'b'} expr.update(b)""" ); doTest("Set[Union[int, str]]", """ def f(): expr, var = set([1, 2, 3]), 'lala' expr.add('b')""" ); doTest("Set[int]", """ def f(): expr = set() expr.add(1) def inner(): expr.add('a') """ ); }