2017-07-03 18:05:08 -04:00
|
|
|
import skip_if
|
|
|
|
skip_if.no_cpython_compat()
|
|
|
|
|
|
|
|
try:
|
2018-05-14 14:43:34 -04:00
|
|
|
from collections import namedtuple
|
2017-07-03 18:05:08 -04:00
|
|
|
except ImportError:
|
|
|
|
skip_if.skip()
|
|
|
|
|
|
|
|
# Try single string
|
|
|
|
T3 = namedtuple("TupComma", "foo bar")
|
|
|
|
t = T3(1, 2)
|
|
|
|
print(t.foo, t.bar)
|
|
|
|
|
|
|
|
# Try single string with comma field separator
|
|
|
|
# Not implemented so far
|
|
|
|
#T2 = namedtuple("TupComma", "foo,bar")
|
|
|
|
#t = T2(1, 2)
|