You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make implicit boolean conversions explicit #106008
By adding a dedicated instruction for converting values to bool, we can easily specialize the conditions of all remaining branches in the bytecode while keeping the branches themselves as "dumb" and simple as possible.
This is one of the few remaining common cases where a little specilization will give us a lot of useful information (such as "this branch won't execute arbitrary code") for higher tiers of optimization. Plus, the most common specializations (such as for bool or None) will be effectively no-ops.
❯ git checkout HEAD^
Previous HEAD position was 7b2d94d8751 GH-106008: Make implicit boolean conversions explicit (GH-106003)
HEAD is now at 6e9f83d9aee GH-106250: Support insts using one cache entry and no oparg (GH-106252)
❯ make -j -s
...
❯ ./python.exe -m test test_grammar -R :
Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 11.57 Run tests sequentially
0:00:00 load avg: 11.57 [1/1] test_grammar
beginning 9 repetitions
123456789
.........
== Tests result: SUCCESS ==
1 test OK.
Total duration: 342 ms
Tests result: SUCCESS
Activity
GH-106008: Make implicit boolean conversions explicit (GH-106003)
pablogsal commentedon Jul 3, 2023
@brandtbucher Apparently this PR introduced a refleak in test_grammar:
The previous commit builds correctly:
can you take a look?
brandtbucher commentedon Jul 3, 2023
Huh. Yeah, I'll take a look.
brandtbucher commentedon Jul 3, 2023
Ah, I think I found it.
GH-106008: Fix refleak when peepholing `None` comparisons (#106367)
Merge branch 'main' into modulelocals