Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
30cf503e
Commit
30cf503e
authored
Feb 2, 2017
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/objset: Make inplace binary operators actually modify the set.
parent
b32880bd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/objset.c
+7
-4
7 additions, 4 deletions
py/objset.c
with
7 additions
and
4 deletions
py/objset.c
+
7
−
4
View file @
30cf503e
...
@@ -489,13 +489,16 @@ STATIC mp_obj_t set_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
...
@@ -489,13 +489,16 @@ STATIC mp_obj_t set_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
case
MP_BINARY_OP_SUBTRACT
:
case
MP_BINARY_OP_SUBTRACT
:
return
set_diff
(
2
,
args
);
return
set_diff
(
2
,
args
);
case
MP_BINARY_OP_INPLACE_OR
:
case
MP_BINARY_OP_INPLACE_OR
:
return
set_union
(
lhs
,
rhs
);
set_update
(
2
,
args
);
return
lhs
;
case
MP_BINARY_OP_INPLACE_XOR
:
case
MP_BINARY_OP_INPLACE_XOR
:
return
set_symmetric_difference
(
lhs
,
rhs
);
set_symmetric_difference_update
(
lhs
,
rhs
);
return
lhs
;
case
MP_BINARY_OP_INPLACE_AND
:
case
MP_BINARY_OP_INPLACE_AND
:
return
set_intersect
(
lhs
,
rhs
);
set_intersect_int
(
lhs
,
rhs
,
true
);
return
lhs
;
case
MP_BINARY_OP_INPLACE_SUBTRACT
:
case
MP_BINARY_OP_INPLACE_SUBTRACT
:
return
set_diff
(
2
,
args
);
return
set_diff
_int
(
2
,
args
,
true
);
case
MP_BINARY_OP_LESS
:
case
MP_BINARY_OP_LESS
:
return
set_issubset_proper
(
lhs
,
rhs
);
return
set_issubset_proper
(
lhs
,
rhs
);
case
MP_BINARY_OP_MORE
:
case
MP_BINARY_OP_MORE
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment