PythonExtra/tests/basics/dict_specialmeth.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
123 B
Python
Raw Normal View History

# dict object with special methods
d = {}
d.__setitem__('2', 'two')
print(d.__getitem__('2'))
d.__delitem__('2')
print(d)