V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
gmywq0392
V2EX  ›  Python

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

  •  
  •   gmywq0392 · 2019-12-03 10:43:28 +08:00 · 2952 次点击
    这是一个创建于 1568 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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-03 10:49:49 +08:00   ❤️ 1
    我的理解:
    需要支持序列化
    wuwukai007
        2
    wuwukai007  
       2019-12-03 10:51:52 +08:00
    from functools import wrap
    @wraps(func)
    Cooky
        3
    Cooky  
       2019-12-03 11:03:23 +08:00 via Android
    windows 没有 fork,要像 Linux 那种 fork 就只能用 pickle 拷贝整个进程
    gmywq0392
        4
    gmywq0392  
    OP
       2019-12-03 11:39:24 +08:00
    @deplives 能详细说下吗,python 中可序列化的条件是什么样的。怎么联系到这个。
    oott123
        5
    oott123  
       2019-12-03 11:49:06 +08:00
    pickable 就是 pickle able
    ytymf
        6
    ytymf  
       2019-12-03 12:40:44 +08:00
    @gmywq0392 大部分的基础数据类型,比如 list,dict 都可以 pickle,类似于 socket,DB connection 不可以
    gmywq0392
        7
    gmywq0392  
    OP
       2019-12-03 13:51:26 +08:00
    @oott123 在下愚钝了,get 不到……
    oott123
        8
    oott123  
       2019-12-03 13:59:45 +08:00 via Android   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5390 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 07:53 · PVG 15:53 · LAX 00:53 · JFK 03:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.