gmywq0392
V2EX  ›  Python

Windows 平台, Python 中 的 pickable 是什么概念?

By gmywq0392 at 2019 年 12 月 3 日 · 4165 次点击
In order to spawn a process under Windows, it needs to be pickable - and many decorated functions or Class methods are not.
8 条回复  •  2019-12-03 13:59:45 +08:00
deplives
   1
deplives  
   2019 年 12 月 3 日   ❤️ 1
我的理解:
需要支持序列化
wuwukai007
   2
wuwukai007  
   2019 年 12 月 3 日
from functools import wrap
@wraps(func)
Cooky
   3
Cooky  
   2019 年 12 月 3 日 via Android
windows 没有 fork,要像 Linux 那种 fork 就只能用 pickle 拷贝整个进程
gmywq0392
   4
gmywq0392  
OP
   2019 年 12 月 3 日
@deplives 能详细说下吗,python 中可序列化的条件是什么样的。怎么联系到这个。
oott123
   5
oott123  
   2019 年 12 月 3 日
pickable 就是 pickle able
ytymf
   6
ytymf  
   2019 年 12 月 3 日
@gmywq0392 大部分的基础数据类型,比如 list,dict 都可以 pickle,类似于 socket,DB connection 不可以
gmywq0392
   7
gmywq0392  
OP
   2019 年 12 月 3 日
@oott123 在下愚钝了,get 不到……
oott123
   8
oott123  
   2019 年 12 月 3 日 via Android   ❤️ 1
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
© 2026 V2EX · 29ms · 3.9.8.5