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
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
14de114b
Commit
14de114b
authored
10 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
objdict: Add __delitem__.
parent
cd94b384
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
py/builtin.h
+1
-0
1 addition, 0 deletions
py/builtin.h
py/objdict.c
+1
-0
1 addition, 0 deletions
py/objdict.c
py/opmethods.c
+6
-0
6 additions, 0 deletions
py/opmethods.c
py/qstrdefs.h
+1
-0
1 addition, 0 deletions
py/qstrdefs.h
with
9 additions
and
0 deletions
py/builtin.h
+
1
−
0
View file @
14de114b
...
...
@@ -38,6 +38,7 @@ MP_DECLARE_CONST_FUN_OBJ(mp_namedtuple_obj);
MP_DECLARE_CONST_FUN_OBJ
(
mp_op_contains_obj
);
MP_DECLARE_CONST_FUN_OBJ
(
mp_op_getitem_obj
);
MP_DECLARE_CONST_FUN_OBJ
(
mp_op_setitem_obj
);
MP_DECLARE_CONST_FUN_OBJ
(
mp_op_delitem_obj
);
extern
const
mp_obj_module_t
mp_module___main__
;
extern
const
mp_obj_module_t
mp_module_array
;
...
...
This diff is collapsed.
Click to expand it.
py/objdict.c
+
1
−
0
View file @
14de114b
...
...
@@ -498,6 +498,7 @@ STATIC const mp_map_elem_t dict_locals_dict_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_values
),
(
mp_obj_t
)
&
dict_values_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___getitem__
),
(
mp_obj_t
)
&
mp_op_getitem_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___setitem__
),
(
mp_obj_t
)
&
mp_op_setitem_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___delitem__
),
(
mp_obj_t
)
&
mp_op_delitem_obj
},
};
STATIC
MP_DEFINE_CONST_DICT
(
dict_locals_dict
,
dict_locals_dict_table
);
...
...
This diff is collapsed.
Click to expand it.
py/opmethods.c
+
6
−
0
View file @
14de114b
...
...
@@ -19,6 +19,12 @@ STATIC mp_obj_t op_setitem(mp_obj_t self_in, mp_obj_t key_in, mp_obj_t value_in)
}
MP_DEFINE_CONST_FUN_OBJ_3
(
mp_op_setitem_obj
,
op_setitem
);
STATIC
mp_obj_t
op_delitem
(
mp_obj_t
self_in
,
mp_obj_t
key_in
)
{
mp_store_subscr
(
self_in
,
key_in
,
MP_OBJ_NULL
);
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_2
(
mp_op_delitem_obj
,
op_delitem
);
STATIC
mp_obj_t
op_contains
(
mp_obj_t
lhs_in
,
mp_obj_t
rhs_in
)
{
mp_obj_type_t
*
type
=
mp_obj_get_type
(
lhs_in
);
return
type
->
binary_op
(
MP_BINARY_OP_IN
,
lhs_in
,
rhs_in
);
...
...
This diff is collapsed.
Click to expand it.
py/qstrdefs.h
+
1
−
0
View file @
14de114b
...
...
@@ -24,6 +24,7 @@ Q(__len__)
Q
(
__iter__
)
Q
(
__getitem__
)
Q
(
__setitem__
)
Q
(
__delitem__
)
Q
(
__add__
)
Q
(
__sub__
)
Q
(
__repr__
)
...
...
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