diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-14 23:44:20 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-14 23:44:20 +0100 |
commit | e10da77a5c4711287319b762c3238121ac10f48e (patch) | |
tree | ed3e62de403a95d1c58a55fb5bcbc8eb7f7e837c /tests/basics/class_item.py | |
parent | 8341725b6513d01045787bdb51952cceb35c29da (diff) | |
parent | a5854d2bc5717cb5b6f589f367acaa6d0c8b0179 (diff) | |
download | micropython-e10da77a5c4711287319b762c3238121ac10f48e.tar.gz micropython-e10da77a5c4711287319b762c3238121ac10f48e.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/basics/class_item.py')
-rw-r--r-- | tests/basics/class_item.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/basics/class_item.py b/tests/basics/class_item.py index 6061f26075..a96817462f 100644 --- a/tests/basics/class_item.py +++ b/tests/basics/class_item.py @@ -1,4 +1,4 @@ -# test class with __getitem__ and __setitem__ methods +# test class with __getitem__, __setitem__, __delitem__ methods class C: def __getitem__(self, item): @@ -8,6 +8,10 @@ class C: def __setitem__(self, item, value): print('set', item, value) + def __delitem__(self, item): + print('del', item) + c = C() print(c[1]) c[1] = 2 +del c[3] |