def test_symbol_pickle():
    import pickle
    try:
        import cPickle
    except __HOLE__:
        cPickle = pickle

    for mod in pickle, cPickle:
        sym1 = util.symbol('foo')
        sym2 = util.symbol('foo')

        assert sym1 is sym2

        # default
        s = pickle.dumps(sym1)
        sym3 = pickle.loads(s)

        for protocol in 0, 1, 2:
            serial = pickle.dumps(sym1)
            rt = pickle.loads(serial)
            assert rt is sym1
            assert rt is sym2
dataset/ETHPy150Open jek/flatland/tests/test_utils.py/test_symbol_pickle