FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-130415: Narrow `int` to `0` based on boolean tests by Klaus117 · Pull Request #130772 · python/cpython · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
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 Lib/test/test_capi/test_opt.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL