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

Appearance settings

GH-130415: Narrow int to 0 based on boolean tests #130772

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 4 commits into from
Mar 4, 2025
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
update definition of false variable for test case
  • Loading branch information
Klaus117 committed Mar 3, 2025
commit daed0954dcba3dd333f5db44d4e3235580fa70e5
3 changes: 2 additions & 1 deletion 3 Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ def f(n):
trace = []
for i in range(n):
# zero is always (int) 0, but we can only prove that it's a integer:
zero = i - i
false = i == TIER2_THRESHOLD # this will always be false, while hopefully still fooling optimizer improvements
zero = false + 0 # this should always set the variable zero equal to 0
trace.append("A")
if not zero: # Kept.
trace.append("B")
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.