fork download
  1. import collections
  2. import pickle
  3. Fred = collections.namedtuple("Fred", ("a", "b"))
  4. y = Fred(1,2)
  5. z = Fred(3,4)
  6. s = pickle.dumps([Fred,y])
  7. print(s)
Success #stdin #stdout 0.04s 28104KB
stdin
Standard input is empty
stdout
b'\x80\x03]q\x00(c__main__\nFred\nq\x01h\x01K\x01K\x02\x86q\x02\x81q\x03e.'