kopia lustrzana https://github.com/micropython/micropython
tests: Add basic test for OrderedDict.
Mostly to have coverage of newly added code in map.c.pull/1163/merge
rodzic
0ef01d0a75
commit
d48035b06b
|
@ -0,0 +1,16 @@
|
|||
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()))
|
Ładowanie…
Reference in New Issue