def test_folding_of_sets_of_constants(self):
    for (line, elem) in (('a in {1,2,3}', frozenset({1, 2, 3})), ('a not in {"a","b","c"}', frozenset({'a', 'c', 'b'})), ('a in {None, 1, None}', frozenset({1, None})), ('a not in {(1, 2), 3, 4}', frozenset({(1, 2), 3, 4})), ('a in {1, 2, 3, 3, 2, 1}', frozenset({1, 2, 3}))):
        code = compile(line, '', 'single')
        self.assertNotInBytecode(code, 'BUILD_SET')
        self.assertInBytecode(code, 'LOAD_CONST', elem)
        self.check_lnotab(code)

    def f(a):
        return (a in {1, 2, 3})

    def g(a):
        return (a not in {1, 2, 3})
    self.assertTrue(f(3))
    self.assertTrue((not f(4)))
    self.check_lnotab(f)
    self.assertTrue((not g(3)))
    self.assertTrue(g(4))
    self.check_lnotab(g)
def test_folding_of_sets_of_constants(self):
    for (line, elem) in (('a in {1,2,3}', frozenset({1, 2, 3})), ('a not in {"a","b","c"}', frozenset({'a', 'c', 'b'})), ('a in {None, 1, None}', frozenset({1, None})), ('a not in {(1, 2), 3, 4}', frozenset({(1, 2), 3, 4})), ('a in {1, 2, 3, 3, 2, 1}', frozenset({1, 2, 3}))):
        code = compile(line, , 'single')
        self.assertNotInBytecode(code, 'BUILD_SET')
        self.assertInBytecode(code, 'LOAD_CONST', elem)
        self.check_lnotab(code)

    def f(a):
        return (a in {1, 2, 3})

    def g(a):
        return (a not in {1, 2, 3})
    self.assertTrue(f(3))
    self.assertTrue((not f(4)))
    self.check_lnotab(f)
    self.assertTrue((not g(3)))
    self.assertTrue(g(4))
    self.check_lnotab(g)