8000 bpo-34100: Partially revert merge_consts_recursive() by vstinner · Pull Request #10743 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34100: Partially revert merge_consts_recursive() #10743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove also the unit test
  • Loading branch information
vstinner committed Nov 27, 2018
commit 7a4d7a5f57106078b2716ac5b062e337eb8ddcb2
10 changes: 0 additions & 10 deletions Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,16 +615,6 @@ def check_same_constant(const):
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}
Expand Down
0