推荐学习书目
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
billgreen1
V2EX  ›  Python

现在写 Python 的包, 还需要兼容 python2 嘛?

  •  
  •   billgreen1 · Jan 18, 2017 · 3062 views
    This topic created in 3425 days ago, the information mentioned may be changed or developed.
    如题,现在公司内部打算写一个包, 主要公司内部自己用,有可能提供给客户 /其他人用.
    已经开发了一部分,使用了很多 python3 特有的东西, 比如 type hint.
    现在想问的就是有必要兼容 python2 嘛?
    7 replies    2017-01-19 11:14:42 +08:00
    JhZ7z587cYROBgVQ
        1
    JhZ7z587cYROBgVQ  
       Jan 18, 2017
    type hint 还是写在注释里面吧 orz ,不是 async await 这种能兼容还是尽量兼容吧,毕竟现在还有好多程序跑在 2 上
    siloong
        2
    siloong  
       Jan 18, 2017
    如果没有历史遗留问题请不要再用 py2 了,我感觉 py2 还这么坚挺的原因就是还有一部分人没有放弃它。
    我一直在用 py3 ,也一直推荐身边的人从 2 转 3
    binux
        3
    binux  
       Jan 18, 2017
    公司内部自己用,不用
    如果是提供给客户的必要组件,例如 SDK ,要。
    sheep3
        4
    sheep3  
       Jan 19, 2017
    我还在用 py3....... 呆了两家公司 leader 都不愿意用 3..... 主要原因是公司所有人用的都是 2
    sheep3
        5
    sheep3  
       Jan 19, 2017
    第一个"py3"改成->py2
    tinyproxy
        6
    tinyproxy  
       Jan 19, 2017 via iPhone
    可以不兼容,比如 aliyun 的 mns SDK ,给客户用的,但只兼容 2 。
    leavic
        7
    leavic  
       Jan 19, 2017
    async await 这种东西我怎么去兼容,根本管不了 py2 了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2938 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 04:18 · PVG 12:18 · LAX 21:18 · JFK 00:18
    ♥ Do have faith in what you're doing.