Message283141
FYI this optimization is already implemented in 3.5+.
>>> def fo():
... if a:
... if b:
... if c:
... print()
...
>>> import dis
>>> dis.dis(fo)
2 0 LOAD_GLOBAL 0 (a)
2 POP_JUMP_IF_FALSE 18
3 4 LOAD_GLOBAL 1 (b)
6 POP_JUMP_IF_FALSE 18
4 8 LOAD_GLOBAL 2 (c)
10 POP_JUMP_IF_FALSE 18
5 12 LOAD_GLOBAL 3 (print)
14 CALL_FUNCTION 0
16 POP_TOP
>> 18 LOAD_CONST 0 (None)
20 RETURN_VALUE |
|
Date |
User |
Action |
Args |
2016-12-13 20:42:49 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, pitrou, vstinner, benjamin.peterson, ezio.melotti, Neal.Norwitz, Winterflower |
2016-12-13 20:42:48 | serhiy.storchaka | set | messageid: <1481661768.97.0.424675161523.issue17430@psf.upfronthosting.co.za> |
2016-12-13 20:42:48 | serhiy.storchaka | link | issue17430 messages |
2016-12-13 20:42:48 | serhiy.storchaka | create | |
|