@@ -723,47 +723,6 @@ All of the following opcodes use their arguments.
723
723
are put onto the stack right-to-left.
724
724
725
725
726
- .. opcode :: BUILD_TUPLE_UNPACK (count)
727
-
728
- Pops ``count `` iterables from the stack, joins them in a single tuple,
729
- and pushes the result.
730
-
731
- .. versionadded :: 3.5
732
-
733
-
734
- .. opcode :: BUILD_LIST_UNPACK (count)
735
-
736
- This is similar to :opcode: `BUILD_TUPLE_UNPACK `, but pushes a list
737
- instead of tuple.
738
-
739
- .. versionadded :: 3.5
740
-
741
-
742
- .. opcode :: BUILD_SET_UNPACK (count)
743
-
744
- This is similar to :opcode: `BUILD_TUPLE_UNPACK `, but pushes a set
745
- instead of tuple.
746
-
747
- .. versionadded :: 3.5
748
-
749
-
750
- .. opcode :: BUILD_MAP_UNPACK (count)
751
-
752
- Pops ``count `` mappings from the stack, joins them in a single dictionary,
753
- and pushes the result.
754
-
755
- .. versionadded :: 3.5
756
-
757
-
758
- .. opcode :: BUILD_MAP_UNPACK_WITH_CALL (count)
759
-
760
- This is similar to :opcode: `BUILD_MAP_UNPACK `,
761
- but is used for ``f(**x, **y, **z) `` call syntax. The stack item at position
762
- ``count + 2 `` should be the corresponding callable ``f ``.
763
-
764
- .. versionadded :: 3.5
765
-
766
-
767
726
.. opcode :: STORE_ATTR (namei)
768
727
769
728
Implements ``TOS.name = TOS1 ``, where *namei * is the index of name in
@@ -813,11 +772,13 @@ All of the following opcodes use their arguments.
813
772
814
773
.. opcode :: BUILD_MAP (count)
815
774
816
- Pushes a new dictionary object onto the stack. Pops ``2 * count `` items
775
+ Pushes a new dictionary object onto the stack. Pops ``2 * count `` items
817
776
so that the dictionary holds ``count `` entries:
818
777
``{..., TOS3: TOS2, TOS1: TOS} ``.
819
778
820
779
.. versionchanged :: 3.5
780
+ The dictionary is created from stack items instead of creating an
781
+ empty dictionary pre-sized to hold ``count `` items.
821
782
822
783
823
784
.. opcode :: BUILD_CONST_KEY_MAP (count)
@@ -837,6 +798,49 @@ All of the following opcodes use their arguments.
837
798
.. versionadded :: 3.6
838
799
839
800
801
+ .. opcode :: BUILD_TUPLE_UNPACK (count)
802
+
803
+ Pops ``count `` iterables from the stack, joins them in a single tuple,
804
+ and pushes the result. This bytecode is used for implementing iterable
805
+ unpacking in tuple displays ``(*x, *y, *z) ``.
806
+
807
+ .. versionadded :: 3.5
808
+
809
+
810
+ .. opcode :: BUILD_LIST_UNPACK (count)
811
+
812
+ This is similar to :opcode: `BUILD_TUPLE_UNPACK `, but pushes a list
813
+ instead of tuple.
814
+
815
+ .. versionadded :: 3.5
816
+
817
+
818
+ .. opcode :: BUILD_SET_UNPACK (count)
819
+
820
+ This is similar to :opcode: `BUILD_TUPLE_UNPACK `, but pushes a set
821
+ instead of tuple.
822
+
823
+ .. versionadded :: 3.5
824
+
825
+
826
+ .. opcode :: BUILD_MAP_UNPACK (count)
827
+
828
+ Pops ``count `` mappings from the stack, joins them in a single dictionary,
829
+ and pushes the result.
830
+
831
+ .. versionadded :: 3.5
832
+
833
+
834
+ .. opcode :: BUILD_MAP_UNPACK_WITH_CALL (oparg)
835
+
836
+ This is similar to :opcode: `BUILD_MAP_UNPACK `,
837
+ but is used for ``f(**x, **y, **z) `` call syntax. The lowest byte of
838
+ ``oparg `` is the count of mappings, the relative position of the
839
+ corresponding callable ``f `` is encoded in the second byte of ``oparg ``.
840
+
841
+ .. versionadded :: 3.5
842
+
843
+
840
844
.. opcode :: LOAD_ATTR (namei)
841
845
842
846
Replaces TOS with ``getattr(TOS, co_names[namei]) ``.
0 commit comments