micropython/tests/basics/namedtuple_asdict.py

21 wiersze
384 B
Python
Czysty Zwykły widok Historia

try:
try:
from ucollections import namedtuple
except ImportError:
from collections import namedtuple
except ImportError:
print("SKIP")
raise SystemExit
t = namedtuple("Tup", ["baz", "foo", "bar"])(3, 2, 5)
try:
t._asdict
except AttributeError:
print("SKIP")
raise SystemExit
d = t._asdict()
print(list(d.keys()))
print(list(d.values()))