Skip to content

Instantly share code, notes, and snippets.

@JooeunAhn
Created December 20, 2017 03:53
Show Gist options
  • Save JooeunAhn/f85a6d20b421e12ddc3e64338a4efe3b to your computer and use it in GitHub Desktop.
Save JooeunAhn/f85a6d20b421e12ddc3e64338a4efe3b to your computer and use it in GitHub Desktop.
>>> import dis
>>> x = [1, 2, 3]
>>> dis.dis('for _ in x: pass')
1 0 SETUP_LOOP 14 (to 17)
3 LOAD_NAME 0 (x)
6 GET_ITER
>> 7 FOR_ITER 6 (to 16)
10 STORE_NAME 1 (_)
13 JUMP_ABSOLUTE 7
>> 16 POP_BLOCK
>> 17 LOAD_CONST 0 (None)
20 RETURN_VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment