Skip to content

Commit 30cf503

Browse files
committed
py/objset: Make inplace binary operators actually modify the set.
1 parent b32880b commit 30cf503

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

py/objset.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,16 @@ STATIC mp_obj_t set_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
489489
case MP_BINARY_OP_SUBTRACT:
490490
return set_diff(2, args);
491491
case MP_BINARY_OP_INPLACE_OR:
492-
return set_union(lhs, rhs);
492+
set_update(2, args);
493+
return lhs;
493494
case MP_BINARY_OP_INPLACE_XOR:
494-
return set_symmetric_difference(lhs, rhs);
495+
set_symmetric_difference_update(lhs, rhs);
496+
return lhs;
495497
case MP_BINARY_OP_INPLACE_AND:
496-
return set_intersect(lhs, rhs);
498+
set_intersect_int(lhs, rhs, true);
499+
return lhs;
497500
case MP_BINARY_OP_INPLACE_SUBTRACT:
498-
return set_diff(2, args);
501+
return set_diff_int(2, args, true);
499502
case MP_BINARY_OP_LESS:
500503
return set_issubset_proper(lhs, rhs);
501504
case MP_BINARY_OP_MORE:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy