Skip to content

Commit 1215dc4

Browse files
blazewiczdpgeorge
authored andcommitted
py/runtime.c: Remove optimization of '*a,=b', it caused a bug.
*a, = b should always make a copy of b, instead, before this patch if b was a list it would copy only a reference to it.
1 parent 88ffe0d commit 1215dc4

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

py/runtime.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,6 @@ void mp_unpack_ex(mp_obj_t seq_in, size_t num_in, mp_obj_t *items) {
854854
if (MP_OBJ_IS_TYPE(seq_in, &mp_type_tuple)) {
855855
mp_obj_tuple_get(seq_in, &seq_len, &seq_items);
856856
} else {
857-
if (num_left == 0 && num_right == 0) {
858-
// *a, = b # sets a to b if b is a list
859-
items[0] = seq_in;
860-
return;
861-
}
862857
mp_obj_list_get(seq_in, &seq_len, &seq_items);
863858
}
864859
if (seq_len < num_left + num_right) {

0 commit comments

Comments
 (0)