def dumps_with_persistent_ids(obj, protocol=None):
"""
Performs a pickle dumps on the given object, substituting all references to
a TradingEnvironment or AssetFinder with tokenized representations.
All arguments are passed to pickle.Pickler and are described therein.
"""
file = BytesIO()
pickler = pickle.Pickler(file, protocol)
pickler.persistent_id = _persistent_id
pickler.dump(obj)
return file.getvalue()
serialization_utils.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录