Python dis module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zhu_dave
    New Member
    • Sep 2005
    • 6

    #1

    Python dis module

    Hello,

    I have a couple of questions on the dis module. Let's say that I have the following disassembled code (It's a simple program which checks to see whether key 'e' is in myDictionary):

    0 LOAD_GLOBAL 0 ( myDictionary )
    3 LOAD_ATTR 1 ( has_key )
    6 LOAD_CONST 1 ( ’e’ )
    9 CALL_FUNCTION 1
    12 PRINT_ITEM
    13 PRINT_NEWLINE
    14 LOAD_CONST 0 ( None )
    17 RETURN_VALUE

    - What are the numbers on the left? Are they line numbers? Why aren't they consecutive?

    - What are the numbers on the right, e.g. LOAD_ATTR [COLOR=Red]1[/COLOR] (has_key)?

    Thanks a lot!
Working...