Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-91389: Fixdis position information forCACHEs#93663

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 7 commits intopython:mainfrombrandtbucher:disposition
Jun 16, 2022
Merged
Changes from1 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
PrevPrevious commit
Naming is hard
  • Loading branch information
@brandtbucher
brandtbucher committedJun 16, 2022
commitd500bf2a0a7875618889919d3a979db0e0e8b33e
8 changes: 4 additions & 4 deletionsLib/test/test_dis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1762,18 +1762,18 @@ def roots(a, b, c):
yield (-b + cmath.sqrt(d)) / (2 * a)
code = roots.__code__
ops = code.co_code[::2]
cache = opcode.opmap["CACHE"]
caches = sum(op ==cache for op in ops)
cache_opcode = opcode.opmap["CACHE"]
caches = sum(op ==cache_opcode for op in ops)
non_caches = len(ops) - caches
# Make sure we have "lots of caches". If not, roots should beupdated:
# Make sure we have "lots of caches". If not, roots should bechanged:
assert 1 / 3 <= caches / non_caches, "this test needs more caches!"
for show_caches in (False, True):
for adaptive in (False, True):
with self.subTest(f"{adaptive=}, {show_caches=}"):
co_positions = [
positions
for op, positions in zip(ops, code.co_positions(), strict=True)
if show_caches or op !=cache
if show_caches or op !=cache_opcode
]
dis_positions = [
instruction.positions
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp