Author serhiy.storchaka
Recipients Neal.Norwitz, Winterflower, benjamin.peterson, ezio.melotti, pitrou, rhettinger, serhiy.storchaka, vstinner
Date 2016-12-13.20:42:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481661768.97.0.424675161523.issue17430@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-12-13 20:42:49serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, pitrou, vstinner, benjamin.peterson, ezio.melotti, Neal.Norwitz, Winterflower
2016-12-13 20:42:48serhiy.storchakasetmessageid: <1481661768.97.0.424675161523.issue17430@psf.upfronthosting.co.za>
2016-12-13 20:42:48serhiy.storchakalinkissue17430 messages
2016-12-13 20:42:48serhiy.storchakacreate