Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/interpreter/test/apptest_compiler.py::test_dont_share_lambdas

def test_dont_share_lambdas():
        if not IS_PYPY:
            skip("pypy-only optimization")
        # the two lambdas's codes aren't shared (CPython does that but it's
        # completely pointless: it only applies to identical lambdas that are
        # defined on the same line)
        code = compile("x = lambda: 0; y = lambda: 0", "<test>", "exec")
        consts = code.co_consts
        x, y, z = consts
        assert isinstance(x, type(code)) and isinstance(y, type(code))
        assert x is not y
>       assert x == y
E       (application-level) AssertionError: assert <code object <lambda> at 0x000000001396a950, file "<test>", line 1> == <code object <lambda> at 0x000000001396a9c0, file "<test>", line 1>

interpreter/test/apptest_compiler.py:216: AssertionError
builder: own-linux-x86-64 build #10997+
test: pypy/interpreter/test/apptest_compiler.py::test_dont_share_lambdas