summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/del-subscr.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-08 21:32:29 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-08 21:32:29 +0100
commitf4c9b33abf0ac6ff97cd39331d125a74fd2bb897 (patch)
tree64bdfb7d6d032d826640e1f9a43956b0b3947591 /tests/basics/del-subscr.py
parent4671392d90e98ea4edf6e9ce7023d21cc9957d8c (diff)
downloadmicropython-f4c9b33abf0ac6ff97cd39331d125a74fd2bb897.tar.gz
micropython-f4c9b33abf0ac6ff97cd39331d125a74fd2bb897.zip
py: Remove DELETE_SUBSCR opcode, combine with STORE_SUBSCR.
This makes the runtime and object APIs more consistent. mp_store_subscr functionality now moved into objects (ie list and dict store_item).
Diffstat (limited to 'tests/basics/del-subscr.py')
-rw-r--r--tests/basics/del-subscr.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/del-subscr.py b/tests/basics/del-subscr.py
new file mode 100644
index 0000000000..67910c6234
--- /dev/null
+++ b/tests/basics/del-subscr.py
@@ -0,0 +1,13 @@
+l = [1, 2, 3]
+print(l)
+del l[0]
+print(l)
+del l[-1]
+print(l)
+
+d = {1:2, 3:4, 5:6}
+del d[1]
+del d[3]
+print(d)
+del d[5]
+print(d)