Skip to content

Commit 5fe6291

Browse files
committed
Response to comments
1 parent 73295ed commit 5fe6291

File tree

1 file changed

+46
-42
lines changed

1 file changed

+46
-42
lines changed

Doc/library/dis.rst

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -723,47 +723,6 @@ All of the following opcodes use their arguments.
723723
are put onto the stack right-to-left.
724724

725725

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-
767726
.. opcode:: STORE_ATTR (namei)
768727

769728
Implements ``TOS.name = TOS1``, where *namei* is the index of name in
@@ -813,11 +772,13 @@ All of the following opcodes use their arguments.
813772

814773
.. opcode:: BUILD_MAP (count)
815774

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
817776
so that the dictionary holds ``count`` entries:
818777
``{..., TOS3: TOS2, TOS1: TOS}``.
819778

820779
.. versionchanged:: 3.5
780+
The dictionary is created from stack items instead of creating an
781+
empty dictionary pre-sized to hold ``count`` items.
821782

822783

823784
.. opcode:: BUILD_CONST_KEY_MAP (count)
@@ -837,6 +798,49 @@ All of the following opcodes use their arguments.
837798
.. versionadded:: 3.6
838799

839800

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+
840844
.. opcode:: LOAD_ATTR (namei)
841845

842846
Replaces TOS with ``getattr(TOS, co_names[namei])``.

0 commit comments

Comments
 (0)