-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. #23743
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. #23743
Conversation
@@ -409,21 +409,6 @@ def f(cond1, cond2): | |||
self.assertLessEqual(len(returns), 6) | |||
self.check_lnotab(f) | |||
|
|||
def test_elim_jump_after_return2(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this test, as doesn't test what it claims to test. There is no dead code in
def f(cond1, cond2):
while 1:
if cond1: return 4
f1c4c1e
to
ca056d4
Compare
…ents conform to PEP 626.
ca056d4
to
a239d48
Compare
🤖 New build scheduled with the buildbot fleet by @markshannon for commit c15f5ab 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
The three failures are, in order:
No leaks, or real failures, so I'm merging. |
|
…d if statements conform to PEP 626. (pythonGH-23743)
(The function this described was deleted by PR #23743, the comment was accidentally retained.)
(The function this described was deleted by PR #23743, the comment was accidentally retained.)
PEP 626 requires all expressions and statements to be traced, even if the code is redundant.
This PR does that for
while
andif
statements.The performance impact on
while 1:
loops is minimized by copying the test to the end of the loop.used to compile to:
It now compiles to:
which will be a tiny bit slower for
while 1
loops and a bit faster for otherwhile
loops.I'm skipping news, as this PR is part of PEP 626 and is covered by that.
https://bugs.python.org/issue42246