circuitpython/tests/basics/ordereddict1.py
Paul Sokolovsky d48035b06b tests: Add basic test for OrderedDict.
Mostly to have coverage of newly added code in map.c.
2015-03-20 17:26:10 +00:00

17 lines
355 B
Python

try:
from collections import OrderedDict
except ImportError:
try:
from _collections import OrderedDict
except ImportError:
print("SKIP")
import sys
sys.exit()
d = OrderedDict([(10, 20), ("b", 100), (1, 2)])
print(list(d.keys()))
print(list(d.values()))
del d["b"]
print(list(d.keys()))
print(list(d.values()))