When can a Python object be pickled

前端 未结 4 925
野性不改
野性不改 2021-02-19 08:20

I\'m doing a fair amount of parallel processing in Python using the multiprocessing module. I know certain objects CAN be pickle (thus passed as arguments in multi-p) and other

4条回答
  •  感情败类
    2021-02-19 08:46

    The general rule of thumb is that "logical" objects can be pickled, but "resource" objects (files, locks) can't, because it makes no sense to persist/clone them.

提交回复
热议问题