fork(2) download
  1. # http://es.stackoverflow.com/q/23328/127
  2. from dis import dis
  3.  
  4. def ne(x):
  5. if x != 'val':
  6. pass
  7.  
  8. def en(x):
  9. if not x == 'val':
  10. pass
  11.  
  12. def ee(x):
  13. if x == 'val':
  14. pass
  15. else:
  16. pass
  17.  
  18. print('!=')
  19. dis(ne)
  20. print('not ==')
  21. dis(en)
  22. print('== else')
  23. dis(ee)
Success #stdin #stdout 0.02s 10392KB
stdin
Standard input is empty
stdout
!=
  5           0 LOAD_FAST                0 (x)
              3 LOAD_CONST               1 ('val')
              6 COMPARE_OP               3 (!=)
              9 POP_JUMP_IF_FALSE       15

  6          12 JUMP_FORWARD             0 (to 15)
        >>   15 LOAD_CONST               0 (None)
             18 RETURN_VALUE
not ==
  9           0 LOAD_FAST                0 (x)
              3 LOAD_CONST               1 ('val')
              6 COMPARE_OP               2 (==)
              9 POP_JUMP_IF_TRUE        15

 10          12 JUMP_FORWARD             0 (to 15)
        >>   15 LOAD_CONST               0 (None)
             18 RETURN_VALUE
== else
 13           0 LOAD_FAST                0 (x)
              3 LOAD_CONST               1 ('val')
              6 COMPARE_OP               2 (==)
              9 POP_JUMP_IF_FALSE       15

 14          12 JUMP_FORWARD             0 (to 15)

 16     >>   15 LOAD_CONST               0 (None)
             18 RETURN_VALUE