OLD | NEW |
1 | 1 |
2 :mod:`dis` --- Disassembler for Python bytecode | 2 :mod:`dis` --- Disassembler for Python bytecode |
3 =============================================== | 3 =============================================== |
4 | 4 |
5 .. module:: dis | 5 .. module:: dis |
6 :synopsis: Disassembler for Python bytecode. | 6 :synopsis: Disassembler for Python bytecode. |
7 | 7 |
8 | 8 |
9 The :mod:`dis` module supports the analysis of Python :term:`bytecode` by disass
embling | 9 The :mod:`dis` module supports the analysis of Python :term:`bytecode` by disass
embling |
10 it. Since there is no Python assembler, this module defines the Python assembly | 10 it. Since there is no Python assembler, this module defines the Python assembly |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 Loads the attribute ``co_names[namei]`` from the module found in TOS. The | 657 Loads the attribute ``co_names[namei]`` from the module found in TOS. The |
658 resulting object is pushed onto the stack, to be subsequently stored by a | 658 resulting object is pushed onto the stack, to be subsequently stored by a |
659 ``STORE_FAST`` instruction. | 659 ``STORE_FAST`` instruction. |
660 | 660 |
661 | 661 |
662 .. opcode:: JUMP_FORWARD (delta) | 662 .. opcode:: JUMP_FORWARD (delta) |
663 | 663 |
664 Increments bytecode counter by *delta*. | 664 Increments bytecode counter by *delta*. |
665 | 665 |
666 | 666 |
667 .. opcode:: JUMP_IF_TRUE (delta) | 667 .. opcode:: POP_JUMP_IF_TRUE (target) |
668 | 668 |
669 If TOS is true, increment the bytecode counter by *delta*. TOS is left on th
e | 669 If TOS is true, sets the bytecode counter to *target*. TOS is popped. |
670 stack. | |
671 | 670 |
672 | 671 |
673 .. opcode:: JUMP_IF_FALSE (delta) | 672 .. opcode:: POP_JUMP_IF_FALSE (target) |
674 | 673 |
675 If TOS is false, increment the bytecode counter by *delta*. TOS is not | 674 If TOS is false, sets the bytecode counter to *target*. TOS is popped. |
676 changed. | 675 |
| 676 |
| 677 .. opcode:: JUMP_IF_TRUE_OR_POP (target) |
| 678 |
| 679 If TOS is true, sets the bytecode counter to *target* and leaves TOS |
| 680 on the stack. Otherwise (TOS is false), TOS is popped. |
| 681 |
| 682 |
| 683 .. opcode:: JUMP_IF_FALSE_OR_POP (target) |
| 684 |
| 685 If TOS is false, sets the bytecode counter to *target* and leaves |
| 686 TOS on the stack. Otherwise (TOS is true), TOS is popped. |
677 | 687 |
678 | 688 |
679 .. opcode:: JUMP_ABSOLUTE (target) | 689 .. opcode:: JUMP_ABSOLUTE (target) |
680 | 690 |
681 Set bytecode counter to *target*. | 691 Set bytecode counter to *target*. |
682 | 692 |
683 | 693 |
684 .. opcode:: FOR_ITER (delta) | 694 .. opcode:: FOR_ITER (delta) |
685 | 695 |
686 ``TOS`` is an :term:`iterator`. Call its :meth:`next` method. If this | 696 ``TOS`` is an :term:`iterator`. Call its :meth:`next` method. If this |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 element on the stack contains the keyword arguments dictionary, followed by t
he | 836 element on the stack contains the keyword arguments dictionary, followed by t
he |
827 variable-arguments tuple, followed by explicit keyword and positional argumen
ts. | 837 variable-arguments tuple, followed by explicit keyword and positional argumen
ts. |
828 | 838 |
829 | 839 |
830 .. opcode:: HAVE_ARGUMENT () | 840 .. opcode:: HAVE_ARGUMENT () |
831 | 841 |
832 This is not really an opcode. It identifies the dividing line between opcode
s | 842 This is not really an opcode. It identifies the dividing line between opcode
s |
833 which don't take arguments ``< HAVE_ARGUMENT`` and those which do ``>= | 843 which don't take arguments ``< HAVE_ARGUMENT`` and those which do ``>= |
834 HAVE_ARGUMENT``. | 844 HAVE_ARGUMENT``. |
835 | 845 |
OLD | NEW |