mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-34100: Partially revert merge_consts_recursive() (GH-10743)
Partically revert commit c2e1607a51
to
fix a reference leak.
This commit is contained in:
parent
480833808e
commit
1005c84535
2 changed files with 0 additions and 60 deletions
|
@ -615,16 +615,6 @@ if 1:
|
|||
self.check_constant(f1, Ellipsis)
|
||||
self.assertEqual(repr(f1()), repr(Ellipsis))
|
||||
|
||||
# Merge constants in tuple or frozenset
|
||||
# NOTE: frozenset can't reuse previous const, but frozenset
|
||||
# item can be reused later.
|
||||
f3 = lambda x: x in {("not a name",)}
|
||||
f1, f2 = lambda: "not a name", lambda: ("not a name",)
|
||||
self.assertIs(next(iter(f3.__code__.co_consts[1])),
|
||||
f2.__code__.co_consts[1])
|
||||
self.assertIs(f1.__code__.co_consts[1],
|
||||
f2.__code__.co_consts[1][0])
|
||||
|
||||
# {0} is converted to a constant frozenset({0}) by the peephole
|
||||
# optimizer
|
||||
f1, f2 = lambda x: x in {0}, lambda x: x in {0}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue