From 2ef1d7f38e612fb82023fd22360e52fb58f3f7bb Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 30 Jul 2023 00:15:28 +0900 Subject: [PATCH 1/4] gh-107427: Update the description of UNPACK_SEQUENCE --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index accc652a90649d9..4c4c61202c3d98e 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -924,7 +924,7 @@ iterations of the loop. Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the stack right-to-left:: - STACK.extend(STACK.pop()[:count:-1]) + STACK.extend(STACK.pop()[:-count-1:-1]) .. opcode:: UNPACK_EX (counts) From 0d5abeaa074715e0a8ebe25b19efc3ce804cd80b Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 30 Jul 2023 10:57:33 +0900 Subject: [PATCH 2/4] Update --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 4c4c61202c3d98e..d1b159cb1828a99 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -921,7 +921,7 @@ iterations of the loop. .. opcode:: UNPACK_SEQUENCE (count) - Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the stack + Unpacks ``STACK.pop()`` into *count* individual values, which are put onto the stack right-to-left:: STACK.extend(STACK.pop()[:-count-1:-1]) From f1c2d472a76790f4c9ff68f806ee57eec8159d1c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 30 Jul 2023 11:00:02 +0900 Subject: [PATCH 3/4] Update --- Doc/library/dis.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index d1b159cb1828a99..055eb2d27e59cbc 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -921,9 +921,10 @@ iterations of the loop. .. opcode:: UNPACK_SEQUENCE (count) - Unpacks ``STACK.pop()`` into *count* individual values, which are put onto the stack + Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the stack right-to-left:: + assert(len(STACK[-1]) == count) STACK.extend(STACK.pop()[:-count-1:-1]) From 43716ba7e9cb482d9040397f512d72d15317661a Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Mon, 31 Jul 2023 00:11:11 +0900 Subject: [PATCH 4/4] Add Guido's suggestion --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 055eb2d27e59cbc..2217c3a80354592 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -922,7 +922,7 @@ iterations of the loop. .. opcode:: UNPACK_SEQUENCE (count) Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the stack - right-to-left:: + right-to-left. Require there to be exactly *count* values.:: assert(len(STACK[-1]) == count) STACK.extend(STACK.pop()[:-count-1:-1])