fork(1) download
import collections
import pickle
x = collections.namedtuple("Fred", ("a", "b"))
y = x(1,2)
z = x(3,4)
s = pickle.dumps([x,y])
print(s)
Runtime error #stdin #stdout #stderr 0.05s 28104KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 6, in <module>
_pickle.PicklingError: Can't pickle <class '__main__.Fred'>: attribute lookup Fred on __main__ failed