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
caizixian
V2EX  ›  Python

Python 之父准备在 Python 中引入类型注解

  •  
  •   caizixian ·
    caizixian · 2014-08-17 14:39:37 +08:00 · 4018 次点击
    这是一个创建于 3556 天前的主题,其中的信息可能已经有所发展或是发生改变。
    14 条回复    2014-08-18 13:34:08 +08:00
    judasnow
        1
    judasnow  
       2014-08-17 15:41:13 +08:00
    不知道2有没有戏(估计没戏)。
    caizixian
        2
    caizixian  
    OP
       2014-08-17 15:44:17 +08:00
    @judasnow 真估计没戏,2走的是小版本号,几乎就是在修bug,enhancement都在3上面做了
    roricon
        3
    roricon  
       2014-08-17 17:43:27 +08:00   ❤️ 1
    很早之前就说过,2以后不会再添加新的feature了吧。
    rcmerci
        4
    rcmerci  
       2014-08-17 18:02:43 +08:00
    2应该不会加了- -
    bombless
        5
    bombless  
       2014-08-17 21:05:58 +08:00   ❤️ 1
    垠神是不是有新帖要发了

    加吧,多加点有用的东西让我有动力抛弃2
    est
        6
    est  
       2014-08-17 21:08:18 +08:00
    这个去年就在PEP里吼了。
    rcmerci
        7
    rcmerci  
       2014-08-17 21:49:00 +08:00
    @bombless 跟垠神什么关系呢?
    zonyitoo
        8
    zonyitoo  
       2014-08-17 21:54:50 +08:00
    文章里不是说这个feature不会集成在Interpreter里面么
    fasling
        9
    fasling  
       2014-08-17 21:55:51 +08:00
    类型注解是啥。。。。
    kavinyao
        10
    kavinyao  
       2014-08-18 01:59:40 +08:00
    已经实现了啊: http://ideone.com/gPvU83

    加入function annotation只是给type checking增加了可能性,还有其他用途,详见: http://legacy.python.org/dev/peps/pep-3107/#use-cases
    bombless
        11
    bombless  
       2014-08-18 06:40:02 +08:00
    @rcmerci pysonar
    rcmerci
        12
    rcmerci  
       2014-08-18 11:34:56 +08:00
    @bombless 哦,对对
    eriale
        13
    eriale  
       2014-08-18 12:54:25 +08:00
    为什么都觉得加type是好事呢?这样不是增加了写代码的约束吗?会不会增加开发的工作量?
    weyou
        14
    weyou  
       2014-08-18 13:34:08 +08:00
    此举应该可以增加pyhon的performance
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2858 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 07:19 · PVG 15:19 · LAX 00:19 · JFK 03:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.