New submission from Daniel Colascione <[EMAIL PROTECTED]>:

Consider:

import dis
def foo():
  if 0 and 1: return "hi"

dis.dis(foo)

What I get is 

  2           0 LOAD_CONST               1 (0)
              3 JUMP_IF_FALSE           15 (to 21)
              6 POP_TOP             
              7 LOAD_CONST               2 (1)
             10 JUMP_IF_FALSE            8 (to 21)
             13 POP_TOP             
             14 LOAD_CONST               3 ('hi')
             17 RETURN_VALUE        
             18 JUMP_FORWARD             1 (to 22)
        >>   21 POP_TOP             
        >>   22 LOAD_CONST               0 (None)
             25 RETURN_VALUE        

What I'd expect to see is:

  1           0 LOAD_CONST               0 (None)
              3 RETURN_VALUE

----------
components: Interpreter Core
messages: 69230
nosy: quotemstr
severity: normal
status: open
title: Control flow not optimized
type: performance
versions: Python 2.5

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to