V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Dec 3, 2019 · 3825 views
    This topic created in 2349 days ago, the information mentioned may be changed or developed.
    In order to spawn a process under Windows, it needs to be pickable - and many decorated functions or Class methods are not.
    
    8 replies    2019-12-03 13:59:45 +08:00
    deplives
        1
    deplives  
       Dec 3, 2019   ❤️ 1
    我的理解:
    需要支持序列化
    wuwukai007
        2
    wuwukai007  
       Dec 3, 2019
    from functools import wrap
    @wraps(func)
    Cooky
        3
    Cooky  
       Dec 3, 2019 via Android
    windows 没有 fork,要像 Linux 那种 fork 就只能用 pickle 拷贝整个进程
    gmywq0392
        4
    gmywq0392  
    OP
       Dec 3, 2019
    @deplives 能详细说下吗,python 中可序列化的条件是什么样的。怎么联系到这个。
    oott123
        5
    oott123  
       Dec 3, 2019
    pickable 就是 pickle able
    ytymf
        6
    ytymf  
       Dec 3, 2019
    @gmywq0392 大部分的基础数据类型,比如 list,dict 都可以 pickle,类似于 socket,DB connection 不可以
    gmywq0392
        7
    gmywq0392  
    OP
       Dec 3, 2019
    @oott123 在下愚钝了,get 不到……
    oott123
        8
    oott123  
       Dec 3, 2019 via Android   ❤️ 1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 116ms · UTC 00:30 · PVG 08:30 · LAX 17:30 · JFK 20:30
    ♥ Do have faith in what you're doing.