Skip to content

Commit

Permalink
fix lambda test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuantengh committed Oct 31, 2024
1 parent 0193b83 commit c563df0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,10 +789,10 @@ def check_same_constant(const):
# Merge constants in tuple or frozenset
f1, f2 = lambda: "not a name", lambda: ("not a name",)
f3 = lambda x: x in {("not a name",)}
self.assertIs(f1.__code__.co_consts[1],
f2.__code__.co_consts[1][0])
self.assertIs(next(iter(f3.__code__.co_consts[1])),
f2.__code__.co_consts[1])
self.assertIs(f1.__code__.co_consts[0],
f2.__code__.co_consts[0][0])
self.assertIs(next(iter(f3.__code__.co_consts[0])),
f2.__code__.co_consts[0])

# {0} is converted to a constant frozenset({0}) by the peephole
# optimizer
Expand Down

0 comments on commit c563df0

Please sign in to comment.